diff --git a/backend/migrations/20221105003256_grant_all.down.sql b/backend/migrations/20221105003256_grant_all.down.sql new file mode 100644 index 0000000000..d2f607c5b8 --- /dev/null +++ b/backend/migrations/20221105003256_grant_all.down.sql @@ -0,0 +1 @@ +-- Add down migration script here diff --git a/backend/migrations/20221105003256_grant_all.up.sql b/backend/migrations/20221105003256_grant_all.up.sql new file mode 100644 index 0000000000..916fdcbbfb --- /dev/null +++ b/backend/migrations/20221105003256_grant_all.up.sql @@ -0,0 +1,13 @@ +-- Add up migration script here + + +GRANT ALL +ON ALL TABLES IN SCHEMA public +TO windmill_user; + + +GRANT ALL +ON ALL TABLES IN SCHEMA public +TO windmill_admin; + +DELETE FROM workspace_invite WHERE workspace_id = 'demo' AND email = 'ruben@windmill.dev'; \ No newline at end of file diff --git a/backend/windmill-api/src/oauth2.rs b/backend/windmill-api/src/oauth2.rs index fd6d2f5b90..e3798ca1af 100644 --- a/backend/windmill-api/src/oauth2.rs +++ b/backend/windmill-api/src/oauth2.rs @@ -802,14 +802,17 @@ async fn login_callback( .await? .unwrap_or(false); if demo_exists { - sqlx::query!( + if let Err(e) = sqlx::query!( "INSERT INTO workspace_invite (workspace_id, email, is_admin) VALUES ('demo', $1, false)", &email ) .execute(&mut tx) - .await?; + .await + { + tracing::error!("error inserting invite: {:#?}", e); + } } } tx.commit().await?;