Skip to content

πŸ“š The open-source, offline-first Notion, Obsidian & Confluence alternative. Advanced Markdown, multi-tenant teams, OIDC/SSO, and local S3 backups. Deploy in one command.

Init with new providers structures

Smaug6739530f8a1b00e1
diff --git a/backend/migrations/000014_oidc_providers.down.sql b/backend/migrations/000014_oidc_providers.down.sql
new file mode 100644
index 00000000..40faf5f3
--- /dev/null
+++ b/backend/migrations/000014_oidc_providers.down.sql
@@ -0,0 +1 @@
+DROP TABLE IF EXISTS `user_oidc_providers`;
diff --git a/backend/migrations/000014_oidc_providers.up.sql b/backend/migrations/000014_oidc_providers.up.sql
new file mode 100644
index 00000000..596be7a6
--- /dev/null
+++ b/backend/migrations/000014_oidc_providers.up.sql
@@ -0,0 +1,13 @@
+CREATE TABLE IF NOT EXISTS `user_oidc_providers` (
+ `id` BIGINT UNSIGNED NOT NULL,
+ `user_id` BIGINT UNSIGNED NOT NULL,
+ `provider_name` VARCHAR(50) NOT NULL,
+ `provider_user_id` VARCHAR(255) NOT NULL,
+ `created_timestamp` BIGINT UNSIGNED NOT NULL,
+ `updated_timestamp` BIGINT UNSIGNED NOT NULL,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `uk_provider_user` (`provider_name`, `provider_user_id`),
+ KEY `idx_user_id` (`user_id`),
+ KEY `idx_provider_name` (`provider_name`),
+ CONSTRAINT `fk_oidc_user` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;