refactor: add single migration file

This commit is contained in:
Mauricio Siu 2024-09-01 22:12:37 -06:00
parent 2593736179
commit 8275aec7d1
48 changed files with 486 additions and 75791 deletions

View File

@ -1,56 +0,0 @@
DO $$ BEGIN
CREATE TYPE "public"."gitProviderType" AS ENUM('github', 'gitlab', 'bitbucket');
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint
CREATE TABLE IF NOT EXISTS "bitbucket_provider" (
"bitbucketProviderId" text PRIMARY KEY NOT NULL,
"bitbucketUsername" text,
"appPassword" text,
"bitbucketWorkspaceName" text,
"gitProviderId" text NOT NULL
);
--> statement-breakpoint
CREATE TABLE IF NOT EXISTS "git_provider" (
"gitProviderId" text PRIMARY KEY NOT NULL,
"providerType" "gitProviderType" DEFAULT 'github' NOT NULL,
"createdAt" text NOT NULL
);
--> statement-breakpoint
CREATE TABLE IF NOT EXISTS "github_provider" (
"githubProviderId" text PRIMARY KEY NOT NULL,
"githubAppId" integer,
"githubClientId" text,
"githubClientSecret" text,
"githubInstallationId" text,
"githubPrivateKey" text,
"githubWebhookSecret" text,
"gitProviderId" text NOT NULL
);
--> statement-breakpoint
CREATE TABLE IF NOT EXISTS "gitlab_provider" (
"github_provider_id" text PRIMARY KEY NOT NULL,
"application_id" text,
"application_secret" text,
"group_name" text,
"gitProviderId" text NOT NULL
);
--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "bitbucket_provider" ADD CONSTRAINT "bitbucket_provider_gitProviderId_git_provider_gitProviderId_fk" FOREIGN KEY ("gitProviderId") REFERENCES "public"."git_provider"("gitProviderId") ON DELETE cascade ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "github_provider" ADD CONSTRAINT "github_provider_gitProviderId_git_provider_gitProviderId_fk" FOREIGN KEY ("gitProviderId") REFERENCES "public"."git_provider"("gitProviderId") ON DELETE cascade ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "gitlab_provider" ADD CONSTRAINT "gitlab_provider_gitProviderId_git_provider_gitProviderId_fk" FOREIGN KEY ("gitProviderId") REFERENCES "public"."git_provider"("gitProviderId") ON DELETE cascade ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;

View File

@ -0,0 +1,142 @@
DO $$ BEGIN
CREATE TYPE "public"."gitProviderType" AS ENUM('github', 'gitlab', 'bitbucket');
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint
ALTER TYPE "sourceType" ADD VALUE 'gitlab';--> statement-breakpoint
ALTER TYPE "sourceType" ADD VALUE 'bitbucket';--> statement-breakpoint
ALTER TYPE "sourceTypeCompose" ADD VALUE 'gitlab';--> statement-breakpoint
ALTER TYPE "sourceTypeCompose" ADD VALUE 'bitbucket';--> statement-breakpoint
CREATE TABLE IF NOT EXISTS "git_provider" (
"gitProviderId" text PRIMARY KEY NOT NULL,
"name" text NOT NULL,
"providerType" "gitProviderType" DEFAULT 'github' NOT NULL,
"createdAt" text NOT NULL,
"authId" text NOT NULL
);
--> statement-breakpoint
CREATE TABLE IF NOT EXISTS "bitbucket" (
"bitbucketId" text PRIMARY KEY NOT NULL,
"bitbucketUsername" text,
"appPassword" text,
"bitbucketWorkspaceName" text,
"gitProviderId" text NOT NULL
);
--> statement-breakpoint
CREATE TABLE IF NOT EXISTS "github" (
"githubId" text PRIMARY KEY NOT NULL,
"githubAppName" text,
"githubAppId" integer,
"githubClientId" text,
"githubClientSecret" text,
"githubInstallationId" text,
"githubPrivateKey" text,
"githubWebhookSecret" text,
"gitProviderId" text NOT NULL
);
--> statement-breakpoint
CREATE TABLE IF NOT EXISTS "gitlab" (
"gitlabId" text PRIMARY KEY NOT NULL,
"application_id" text,
"redirect_uri" text,
"secret" text,
"access_token" text,
"refresh_token" text,
"group_name" text,
"expires_at" integer,
"gitProviderId" text NOT NULL
);
--> statement-breakpoint
ALTER TABLE "application" ADD COLUMN "gitlabProjectId" integer;--> statement-breakpoint
ALTER TABLE "application" ADD COLUMN "gitlabRepository" text;--> statement-breakpoint
ALTER TABLE "application" ADD COLUMN "gitlabOwner" text;--> statement-breakpoint
ALTER TABLE "application" ADD COLUMN "gitlabBranch" text;--> statement-breakpoint
ALTER TABLE "application" ADD COLUMN "gitlabBuildPath" text DEFAULT '/';--> statement-breakpoint
ALTER TABLE "application" ADD COLUMN "gitlabPathNamespace" text;--> statement-breakpoint
ALTER TABLE "application" ADD COLUMN "bitbucketRepository" text;--> statement-breakpoint
ALTER TABLE "application" ADD COLUMN "bitbucketOwner" text;--> statement-breakpoint
ALTER TABLE "application" ADD COLUMN "bitbucketBranch" text;--> statement-breakpoint
ALTER TABLE "application" ADD COLUMN "bitbucketBuildPath" text DEFAULT '/';--> statement-breakpoint
ALTER TABLE "application" ADD COLUMN "githubId" text;--> statement-breakpoint
ALTER TABLE "application" ADD COLUMN "gitlabId" text;--> statement-breakpoint
ALTER TABLE "application" ADD COLUMN "bitbucketId" text;--> statement-breakpoint
ALTER TABLE "user" ADD COLUMN "canAccessToGitProviders" boolean DEFAULT false NOT NULL;--> statement-breakpoint
ALTER TABLE "compose" ADD COLUMN "gitlabProjectId" integer;--> statement-breakpoint
ALTER TABLE "compose" ADD COLUMN "gitlabRepository" text;--> statement-breakpoint
ALTER TABLE "compose" ADD COLUMN "gitlabOwner" text;--> statement-breakpoint
ALTER TABLE "compose" ADD COLUMN "gitlabBranch" text;--> statement-breakpoint
ALTER TABLE "compose" ADD COLUMN "gitlabPathNamespace" text;--> statement-breakpoint
ALTER TABLE "compose" ADD COLUMN "bitbucketRepository" text;--> statement-breakpoint
ALTER TABLE "compose" ADD COLUMN "bitbucketOwner" text;--> statement-breakpoint
ALTER TABLE "compose" ADD COLUMN "bitbucketBranch" text;--> statement-breakpoint
ALTER TABLE "compose" ADD COLUMN "githubId" text;--> statement-breakpoint
ALTER TABLE "compose" ADD COLUMN "gitlabId" text;--> statement-breakpoint
ALTER TABLE "compose" ADD COLUMN "bitbucketId" text;--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "git_provider" ADD CONSTRAINT "git_provider_authId_auth_id_fk" FOREIGN KEY ("authId") REFERENCES "public"."auth"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "bitbucket" ADD CONSTRAINT "bitbucket_gitProviderId_git_provider_gitProviderId_fk" FOREIGN KEY ("gitProviderId") REFERENCES "public"."git_provider"("gitProviderId") ON DELETE cascade ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "github" ADD CONSTRAINT "github_gitProviderId_git_provider_gitProviderId_fk" FOREIGN KEY ("gitProviderId") REFERENCES "public"."git_provider"("gitProviderId") ON DELETE cascade ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "gitlab" ADD CONSTRAINT "gitlab_gitProviderId_git_provider_gitProviderId_fk" FOREIGN KEY ("gitProviderId") REFERENCES "public"."git_provider"("gitProviderId") ON DELETE cascade ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "application" ADD CONSTRAINT "application_githubId_github_githubId_fk" FOREIGN KEY ("githubId") REFERENCES "public"."github"("githubId") ON DELETE set null ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "application" ADD CONSTRAINT "application_gitlabId_gitlab_gitlabId_fk" FOREIGN KEY ("gitlabId") REFERENCES "public"."gitlab"("gitlabId") ON DELETE set null ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "application" ADD CONSTRAINT "application_bitbucketId_bitbucket_bitbucketId_fk" FOREIGN KEY ("bitbucketId") REFERENCES "public"."bitbucket"("bitbucketId") ON DELETE set null ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "compose" ADD CONSTRAINT "compose_githubId_github_githubId_fk" FOREIGN KEY ("githubId") REFERENCES "public"."github"("githubId") ON DELETE set null ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "compose" ADD CONSTRAINT "compose_gitlabId_gitlab_gitlabId_fk" FOREIGN KEY ("gitlabId") REFERENCES "public"."gitlab"("gitlabId") ON DELETE set null ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "compose" ADD CONSTRAINT "compose_bitbucketId_bitbucket_bitbucketId_fk" FOREIGN KEY ("bitbucketId") REFERENCES "public"."bitbucket"("bitbucketId") ON DELETE set null ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint
ALTER TABLE "admin" DROP COLUMN IF EXISTS "githubAppId";--> statement-breakpoint
ALTER TABLE "admin" DROP COLUMN IF EXISTS "githubAppName";--> statement-breakpoint
ALTER TABLE "admin" DROP COLUMN IF EXISTS "githubClientId";--> statement-breakpoint
ALTER TABLE "admin" DROP COLUMN IF EXISTS "githubClientSecret";--> statement-breakpoint
ALTER TABLE "admin" DROP COLUMN IF EXISTS "githubInstallationId";--> statement-breakpoint
ALTER TABLE "admin" DROP COLUMN IF EXISTS "githubPrivateKey";--> statement-breakpoint
ALTER TABLE "admin" DROP COLUMN IF EXISTS "githubWebhookSecret";

View File

@ -1,6 +0,0 @@
ALTER TABLE "git_provider" ADD COLUMN "authId" text NOT NULL;--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "git_provider" ADD CONSTRAINT "git_provider_authId_auth_id_fk" FOREIGN KEY ("authId") REFERENCES "public"."auth"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;

View File

@ -1 +0,0 @@
ALTER TABLE "github_provider" ADD COLUMN "githubAppName" text;

View File

@ -1,6 +0,0 @@
ALTER TABLE "application" ADD COLUMN "githubProviderId" text;--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "application" ADD CONSTRAINT "application_githubProviderId_github_provider_githubProviderId_fk" FOREIGN KEY ("githubProviderId") REFERENCES "public"."github_provider"("githubProviderId") ON DELETE cascade ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;

View File

@ -1,8 +0,0 @@
ALTER TABLE "application" DROP CONSTRAINT "application_githubProviderId_github_provider_githubProviderId_fk";
--> statement-breakpoint
ALTER TABLE "git_provider" ADD COLUMN "name" text NOT NULL;--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "application" ADD CONSTRAINT "application_githubProviderId_github_provider_githubProviderId_fk" FOREIGN KEY ("githubProviderId") REFERENCES "public"."github_provider"("githubProviderId") ON DELETE set null ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;

View File

@ -1 +0,0 @@
ALTER TABLE "gitlab_provider" RENAME COLUMN "github_provider_id" TO "gitlabProviderId";

View File

@ -1 +0,0 @@
ALTER TABLE "gitlab_provider" RENAME COLUMN "application_secret" TO "secret";

View File

@ -1 +0,0 @@
ALTER TABLE "gitlab_provider" ADD COLUMN "token" text;

View File

@ -1 +0,0 @@
ALTER TABLE "gitlab_provider" ADD COLUMN "redirect_uri" text;

View File

@ -1,2 +0,0 @@
ALTER TABLE "gitlab_provider" ADD COLUMN "access_token" text;--> statement-breakpoint
ALTER TABLE "gitlab_provider" ADD COLUMN "refresh_token" text;

View File

@ -1 +0,0 @@
ALTER TABLE "gitlab_provider" DROP COLUMN IF EXISTS "token";

View File

@ -1,19 +0,0 @@
ALTER TYPE "sourceType" ADD VALUE 'gitlab';--> statement-breakpoint
ALTER TYPE "sourceType" ADD VALUE 'bitbucket';--> statement-breakpoint
ALTER TABLE "application" ADD COLUMN "gitlabRepository" text;--> statement-breakpoint
ALTER TABLE "application" ADD COLUMN "gitlabOwner" text;--> statement-breakpoint
ALTER TABLE "application" ADD COLUMN "gitlabBranch" text;--> statement-breakpoint
ALTER TABLE "application" ADD COLUMN "gitlabBuildPath" text DEFAULT '/';--> statement-breakpoint
ALTER TABLE "application" ADD COLUMN "gitlabProviderId" text;--> statement-breakpoint
ALTER TABLE "application" ADD COLUMN "bitbucketProviderId" text;--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "application" ADD CONSTRAINT "application_gitlabProviderId_gitlab_provider_gitlabProviderId_fk" FOREIGN KEY ("gitlabProviderId") REFERENCES "public"."gitlab_provider"("gitlabProviderId") ON DELETE set null ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "application" ADD CONSTRAINT "application_bitbucketProviderId_bitbucket_provider_bitbucketProviderId_fk" FOREIGN KEY ("bitbucketProviderId") REFERENCES "public"."bitbucket_provider"("bitbucketProviderId") ON DELETE set null ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;

View File

@ -1,4 +0,0 @@
ALTER TABLE "application" ADD COLUMN "bitbucketRepository" text;--> statement-breakpoint
ALTER TABLE "application" ADD COLUMN "bitbucketOwner" text;--> statement-breakpoint
ALTER TABLE "application" ADD COLUMN "bitbucketBranch" text;--> statement-breakpoint
ALTER TABLE "application" ADD COLUMN "bitbucketBuildPath" text DEFAULT '/';

View File

@ -1 +0,0 @@
ALTER TABLE "gitlab_provider" ADD COLUMN "expires_at" integer;

View File

@ -1,37 +0,0 @@
ALTER TABLE "application" RENAME COLUMN "githubProviderId" TO "githubId";--> statement-breakpoint
ALTER TABLE "application" RENAME COLUMN "gitlabProviderId" TO "gitlabId";--> statement-breakpoint
ALTER TABLE "application" RENAME COLUMN "bitbucketProviderId" TO "bitbucketId";--> statement-breakpoint
ALTER TABLE "bitbucket_provider" RENAME COLUMN "bitbucketProviderId" TO "bitbucketId";--> statement-breakpoint
ALTER TABLE "github_provider" RENAME COLUMN "githubProviderId" TO "githubId";--> statement-breakpoint
ALTER TABLE "gitlab_provider" RENAME COLUMN "gitlabProviderId" TO "gitlabId";--> statement-breakpoint
ALTER TABLE "application" DROP CONSTRAINT "application_githubProviderId_github_provider_githubProviderId_fk";
--> statement-breakpoint
ALTER TABLE "application" DROP CONSTRAINT "application_gitlabProviderId_gitlab_provider_gitlabProviderId_fk";
--> statement-breakpoint
ALTER TABLE "application" DROP CONSTRAINT "application_bitbucketProviderId_bitbucket_provider_bitbucketProviderId_fk";
--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "application" ADD CONSTRAINT "application_githubId_github_provider_githubId_fk" FOREIGN KEY ("githubId") REFERENCES "public"."github_provider"("githubId") ON DELETE set null ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "application" ADD CONSTRAINT "application_gitlabId_gitlab_provider_gitlabId_fk" FOREIGN KEY ("gitlabId") REFERENCES "public"."gitlab_provider"("gitlabId") ON DELETE set null ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "application" ADD CONSTRAINT "application_bitbucketId_bitbucket_provider_bitbucketId_fk" FOREIGN KEY ("bitbucketId") REFERENCES "public"."bitbucket_provider"("bitbucketId") ON DELETE set null ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint
ALTER TABLE "admin" DROP COLUMN IF EXISTS "githubAppId";--> statement-breakpoint
ALTER TABLE "admin" DROP COLUMN IF EXISTS "githubAppName";--> statement-breakpoint
ALTER TABLE "admin" DROP COLUMN IF EXISTS "githubClientId";--> statement-breakpoint
ALTER TABLE "admin" DROP COLUMN IF EXISTS "githubClientSecret";--> statement-breakpoint
ALTER TABLE "admin" DROP COLUMN IF EXISTS "githubInstallationId";--> statement-breakpoint
ALTER TABLE "admin" DROP COLUMN IF EXISTS "githubPrivateKey";--> statement-breakpoint
ALTER TABLE "admin" DROP COLUMN IF EXISTS "githubWebhookSecret";

View File

@ -1 +0,0 @@
ALTER TABLE "application" ADD COLUMN "gitlabProjectId" integer;

View File

@ -1,31 +0,0 @@
ALTER TYPE "sourceTypeCompose" ADD VALUE 'gitlab';--> statement-breakpoint
ALTER TYPE "sourceTypeCompose" ADD VALUE 'bitbucket';--> statement-breakpoint
ALTER TABLE "compose" ADD COLUMN "gitlabProjectId" integer;--> statement-breakpoint
ALTER TABLE "compose" ADD COLUMN "gitlabRepository" text;--> statement-breakpoint
ALTER TABLE "compose" ADD COLUMN "gitlabOwner" text;--> statement-breakpoint
ALTER TABLE "compose" ADD COLUMN "gitlabBranch" text;--> statement-breakpoint
ALTER TABLE "compose" ADD COLUMN "gitlabBuildPath" text DEFAULT '/';--> statement-breakpoint
ALTER TABLE "compose" ADD COLUMN "bitbucketRepository" text;--> statement-breakpoint
ALTER TABLE "compose" ADD COLUMN "bitbucketOwner" text;--> statement-breakpoint
ALTER TABLE "compose" ADD COLUMN "bitbucketBranch" text;--> statement-breakpoint
ALTER TABLE "compose" ADD COLUMN "bitbucketBuildPath" text DEFAULT '/';--> statement-breakpoint
ALTER TABLE "compose" ADD COLUMN "githubId" text;--> statement-breakpoint
ALTER TABLE "compose" ADD COLUMN "gitlabId" text;--> statement-breakpoint
ALTER TABLE "compose" ADD COLUMN "bitbucketId" text;--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "compose" ADD CONSTRAINT "compose_githubId_github_provider_githubId_fk" FOREIGN KEY ("githubId") REFERENCES "public"."github_provider"("githubId") ON DELETE set null ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "compose" ADD CONSTRAINT "compose_gitlabId_gitlab_provider_gitlabId_fk" FOREIGN KEY ("gitlabId") REFERENCES "public"."gitlab_provider"("gitlabId") ON DELETE set null ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "compose" ADD CONSTRAINT "compose_bitbucketId_bitbucket_provider_bitbucketId_fk" FOREIGN KEY ("bitbucketId") REFERENCES "public"."bitbucket_provider"("bitbucketId") ON DELETE set null ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;

View File

@ -1,2 +0,0 @@
ALTER TABLE "compose" DROP COLUMN IF EXISTS "gitlabBuildPath";--> statement-breakpoint
ALTER TABLE "compose" DROP COLUMN IF EXISTS "bitbucketBuildPath";

View File

@ -1 +0,0 @@
ALTER TABLE "compose" ADD COLUMN "gitlabHttpUrl" text;

View File

@ -1 +0,0 @@
ALTER TABLE "compose" RENAME COLUMN "gitlabHttpUrl" TO "gitlabPath";

View File

@ -1,2 +0,0 @@
ALTER TABLE "compose" RENAME COLUMN "gitlabPath" TO "gitlabPathNamespace";--> statement-breakpoint
ALTER TABLE "application" ADD COLUMN "gitlabPathNamespace" text;

View File

@ -1 +0,0 @@
ALTER TABLE "user" ADD COLUMN "canAccessToGitProviders" boolean DEFAULT false NOT NULL;

View File

@ -1,74 +0,0 @@
ALTER TABLE "bitbucket_provider" RENAME TO "bitbucket";--> statement-breakpoint
ALTER TABLE "github_provider" RENAME TO "github";--> statement-breakpoint
ALTER TABLE "gitlab_provider" RENAME TO "gitlab";--> statement-breakpoint
ALTER TABLE "application" DROP CONSTRAINT "application_githubId_github_provider_githubId_fk";
--> statement-breakpoint
ALTER TABLE "application" DROP CONSTRAINT "application_gitlabId_gitlab_provider_gitlabId_fk";
--> statement-breakpoint
ALTER TABLE "application" DROP CONSTRAINT "application_bitbucketId_bitbucket_provider_bitbucketId_fk";
--> statement-breakpoint
ALTER TABLE "compose" DROP CONSTRAINT "compose_githubId_github_provider_githubId_fk";
--> statement-breakpoint
ALTER TABLE "compose" DROP CONSTRAINT "compose_gitlabId_gitlab_provider_gitlabId_fk";
--> statement-breakpoint
ALTER TABLE "compose" DROP CONSTRAINT "compose_bitbucketId_bitbucket_provider_bitbucketId_fk";
--> statement-breakpoint
ALTER TABLE "bitbucket" DROP CONSTRAINT "bitbucket_provider_gitProviderId_git_provider_gitProviderId_fk";
--> statement-breakpoint
ALTER TABLE "github" DROP CONSTRAINT "github_provider_gitProviderId_git_provider_gitProviderId_fk";
--> statement-breakpoint
ALTER TABLE "gitlab" DROP CONSTRAINT "gitlab_provider_gitProviderId_git_provider_gitProviderId_fk";
--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "application" ADD CONSTRAINT "application_githubId_github_githubId_fk" FOREIGN KEY ("githubId") REFERENCES "public"."github"("githubId") ON DELETE set null ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "application" ADD CONSTRAINT "application_gitlabId_gitlab_gitlabId_fk" FOREIGN KEY ("gitlabId") REFERENCES "public"."gitlab"("gitlabId") ON DELETE set null ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "application" ADD CONSTRAINT "application_bitbucketId_bitbucket_bitbucketId_fk" FOREIGN KEY ("bitbucketId") REFERENCES "public"."bitbucket"("bitbucketId") ON DELETE set null ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "compose" ADD CONSTRAINT "compose_githubId_github_githubId_fk" FOREIGN KEY ("githubId") REFERENCES "public"."github"("githubId") ON DELETE set null ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "compose" ADD CONSTRAINT "compose_gitlabId_gitlab_gitlabId_fk" FOREIGN KEY ("gitlabId") REFERENCES "public"."gitlab"("gitlabId") ON DELETE set null ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "compose" ADD CONSTRAINT "compose_bitbucketId_bitbucket_bitbucketId_fk" FOREIGN KEY ("bitbucketId") REFERENCES "public"."bitbucket"("bitbucketId") ON DELETE set null ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "bitbucket" ADD CONSTRAINT "bitbucket_gitProviderId_git_provider_gitProviderId_fk" FOREIGN KEY ("gitProviderId") REFERENCES "public"."git_provider"("gitProviderId") ON DELETE cascade ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "github" ADD CONSTRAINT "github_gitProviderId_git_provider_gitProviderId_fk" FOREIGN KEY ("gitProviderId") REFERENCES "public"."git_provider"("gitProviderId") ON DELETE cascade ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "gitlab" ADD CONSTRAINT "gitlab_gitProviderId_git_provider_gitProviderId_fk" FOREIGN KEY ("gitProviderId") REFERENCES "public"."git_provider"("gitProviderId") ON DELETE cascade ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;

View File

@ -1,5 +1,5 @@
{
"id": "abd84c5e-748b-4e64-9bfc-cefa7a6bb5aa",
"id": "4b757666-9e18-454e-9cfa-762d03bf378f",
"prevId": "ce8a8861-2970-4889-ac2e-3cfe60d12736",
"version": "6",
"dialect": "postgresql",
@ -137,6 +137,68 @@
"primaryKey": false,
"notNull": false
},
"gitlabProjectId": {
"name": "gitlabProjectId",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"gitlabRepository": {
"name": "gitlabRepository",
"type": "text",
"primaryKey": false,
"notNull": false
},
"gitlabOwner": {
"name": "gitlabOwner",
"type": "text",
"primaryKey": false,
"notNull": false
},
"gitlabBranch": {
"name": "gitlabBranch",
"type": "text",
"primaryKey": false,
"notNull": false
},
"gitlabBuildPath": {
"name": "gitlabBuildPath",
"type": "text",
"primaryKey": false,
"notNull": false,
"default": "'/'"
},
"gitlabPathNamespace": {
"name": "gitlabPathNamespace",
"type": "text",
"primaryKey": false,
"notNull": false
},
"bitbucketRepository": {
"name": "bitbucketRepository",
"type": "text",
"primaryKey": false,
"notNull": false
},
"bitbucketOwner": {
"name": "bitbucketOwner",
"type": "text",
"primaryKey": false,
"notNull": false
},
"bitbucketBranch": {
"name": "bitbucketBranch",
"type": "text",
"primaryKey": false,
"notNull": false
},
"bitbucketBuildPath": {
"name": "bitbucketBuildPath",
"type": "text",
"primaryKey": false,
"notNull": false,
"default": "'/'"
},
"username": {
"name": "username",
"type": "text",
@ -291,6 +353,24 @@
"type": "text",
"primaryKey": false,
"notNull": true
},
"githubId": {
"name": "githubId",
"type": "text",
"primaryKey": false,
"notNull": false
},
"gitlabId": {
"name": "gitlabId",
"type": "text",
"primaryKey": false,
"notNull": false
},
"bitbucketId": {
"name": "bitbucketId",
"type": "text",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
@ -333,6 +413,45 @@
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"application_githubId_github_githubId_fk": {
"name": "application_githubId_github_githubId_fk",
"tableFrom": "application",
"tableTo": "github",
"columnsFrom": [
"githubId"
],
"columnsTo": [
"githubId"
],
"onDelete": "set null",
"onUpdate": "no action"
},
"application_gitlabId_gitlab_gitlabId_fk": {
"name": "application_gitlabId_gitlab_gitlabId_fk",
"tableFrom": "application",
"tableTo": "gitlab",
"columnsFrom": [
"gitlabId"
],
"columnsTo": [
"gitlabId"
],
"onDelete": "set null",
"onUpdate": "no action"
},
"application_bitbucketId_bitbucket_bitbucketId_fk": {
"name": "application_bitbucketId_bitbucket_bitbucketId_fk",
"tableFrom": "application",
"tableTo": "bitbucket",
"columnsFrom": [
"bitbucketId"
],
"columnsTo": [
"bitbucketId"
],
"onDelete": "set null",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
@ -572,6 +691,13 @@
"notNull": true,
"default": false
},
"canAccessToGitProviders": {
"name": "canAccessToGitProviders",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"canAccessToTraefikFiles": {
"name": "canAccessToTraefikFiles",
"type": "boolean",
@ -648,18 +774,6 @@
"primaryKey": true,
"notNull": true
},
"githubAppId": {
"name": "githubAppId",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"githubAppName": {
"name": "githubAppName",
"type": "text",
"primaryKey": false,
"notNull": false
},
"serverIp": {
"name": "serverIp",
"type": "text",
@ -680,36 +794,6 @@
"primaryKey": false,
"notNull": false
},
"githubClientId": {
"name": "githubClientId",
"type": "text",
"primaryKey": false,
"notNull": false
},
"githubClientSecret": {
"name": "githubClientSecret",
"type": "text",
"primaryKey": false,
"notNull": false
},
"githubInstallationId": {
"name": "githubInstallationId",
"type": "text",
"primaryKey": false,
"notNull": false
},
"githubPrivateKey": {
"name": "githubPrivateKey",
"type": "text",
"primaryKey": false,
"notNull": false
},
"githubWebhookSecret": {
"name": "githubWebhookSecret",
"type": "text",
"primaryKey": false,
"notNull": false
},
"letsEncryptEmail": {
"name": "letsEncryptEmail",
"type": "text",
@ -2432,6 +2516,54 @@
"primaryKey": false,
"notNull": false
},
"gitlabProjectId": {
"name": "gitlabProjectId",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"gitlabRepository": {
"name": "gitlabRepository",
"type": "text",
"primaryKey": false,
"notNull": false
},
"gitlabOwner": {
"name": "gitlabOwner",
"type": "text",
"primaryKey": false,
"notNull": false
},
"gitlabBranch": {
"name": "gitlabBranch",
"type": "text",
"primaryKey": false,
"notNull": false
},
"gitlabPathNamespace": {
"name": "gitlabPathNamespace",
"type": "text",
"primaryKey": false,
"notNull": false
},
"bitbucketRepository": {
"name": "bitbucketRepository",
"type": "text",
"primaryKey": false,
"notNull": false
},
"bitbucketOwner": {
"name": "bitbucketOwner",
"type": "text",
"primaryKey": false,
"notNull": false
},
"bitbucketBranch": {
"name": "bitbucketBranch",
"type": "text",
"primaryKey": false,
"notNull": false
},
"customGitUrl": {
"name": "customGitUrl",
"type": "text",
@ -2483,6 +2615,24 @@
"type": "text",
"primaryKey": false,
"notNull": true
},
"githubId": {
"name": "githubId",
"type": "text",
"primaryKey": false,
"notNull": false
},
"gitlabId": {
"name": "gitlabId",
"type": "text",
"primaryKey": false,
"notNull": false
},
"bitbucketId": {
"name": "bitbucketId",
"type": "text",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
@ -2512,6 +2662,45 @@
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"compose_githubId_github_githubId_fk": {
"name": "compose_githubId_github_githubId_fk",
"tableFrom": "compose",
"tableTo": "github",
"columnsFrom": [
"githubId"
],
"columnsTo": [
"githubId"
],
"onDelete": "set null",
"onUpdate": "no action"
},
"compose_gitlabId_gitlab_gitlabId_fk": {
"name": "compose_gitlabId_gitlab_gitlabId_fk",
"tableFrom": "compose",
"tableTo": "gitlab",
"columnsFrom": [
"gitlabId"
],
"columnsTo": [
"gitlabId"
],
"onDelete": "set null",
"onUpdate": "no action"
},
"compose_bitbucketId_bitbucket_bitbucketId_fk": {
"name": "compose_bitbucketId_bitbucket_bitbucketId_fk",
"tableFrom": "compose",
"tableTo": "bitbucket",
"columnsFrom": [
"bitbucketId"
],
"columnsTo": [
"bitbucketId"
],
"onDelete": "set null",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
@ -2920,12 +3109,68 @@
"compositePrimaryKeys": {},
"uniqueConstraints": {}
},
"public.bitbucket_provider": {
"name": "bitbucket_provider",
"public.git_provider": {
"name": "git_provider",
"schema": "",
"columns": {
"bitbucketProviderId": {
"name": "bitbucketProviderId",
"gitProviderId": {
"name": "gitProviderId",
"type": "text",
"primaryKey": true,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"providerType": {
"name": "providerType",
"type": "gitProviderType",
"typeSchema": "public",
"primaryKey": false,
"notNull": true,
"default": "'github'"
},
"createdAt": {
"name": "createdAt",
"type": "text",
"primaryKey": false,
"notNull": true
},
"authId": {
"name": "authId",
"type": "text",
"primaryKey": false,
"notNull": true
}
},
"indexes": {},
"foreignKeys": {
"git_provider_authId_auth_id_fk": {
"name": "git_provider_authId_auth_id_fk",
"tableFrom": "git_provider",
"tableTo": "auth",
"columnsFrom": [
"authId"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
},
"public.bitbucket": {
"name": "bitbucket",
"schema": "",
"columns": {
"bitbucketId": {
"name": "bitbucketId",
"type": "text",
"primaryKey": true,
"notNull": true
@ -2957,9 +3202,9 @@
},
"indexes": {},
"foreignKeys": {
"bitbucket_provider_gitProviderId_git_provider_gitProviderId_fk": {
"name": "bitbucket_provider_gitProviderId_git_provider_gitProviderId_fk",
"tableFrom": "bitbucket_provider",
"bitbucket_gitProviderId_git_provider_gitProviderId_fk": {
"name": "bitbucket_gitProviderId_git_provider_gitProviderId_fk",
"tableFrom": "bitbucket",
"tableTo": "git_provider",
"columnsFrom": [
"gitProviderId"
@ -2974,45 +3219,21 @@
"compositePrimaryKeys": {},
"uniqueConstraints": {}
},
"public.git_provider": {
"name": "git_provider",
"public.github": {
"name": "github",
"schema": "",
"columns": {
"gitProviderId": {
"name": "gitProviderId",
"githubId": {
"name": "githubId",
"type": "text",
"primaryKey": true,
"notNull": true
},
"providerType": {
"name": "providerType",
"type": "gitProviderType",
"typeSchema": "public",
"primaryKey": false,
"notNull": true,
"default": "'github'"
},
"createdAt": {
"name": "createdAt",
"githubAppName": {
"name": "githubAppName",
"type": "text",
"primaryKey": false,
"notNull": true
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
},
"public.github_provider": {
"name": "github_provider",
"schema": "",
"columns": {
"githubProviderId": {
"name": "githubProviderId",
"type": "text",
"primaryKey": true,
"notNull": true
"notNull": false
},
"githubAppId": {
"name": "githubAppId",
@ -3059,9 +3280,9 @@
},
"indexes": {},
"foreignKeys": {
"github_provider_gitProviderId_git_provider_gitProviderId_fk": {
"name": "github_provider_gitProviderId_git_provider_gitProviderId_fk",
"tableFrom": "github_provider",
"github_gitProviderId_git_provider_gitProviderId_fk": {
"name": "github_gitProviderId_git_provider_gitProviderId_fk",
"tableFrom": "github",
"tableTo": "git_provider",
"columnsFrom": [
"gitProviderId"
@ -3076,12 +3297,12 @@
"compositePrimaryKeys": {},
"uniqueConstraints": {}
},
"public.gitlab_provider": {
"name": "gitlab_provider",
"public.gitlab": {
"name": "gitlab",
"schema": "",
"columns": {
"github_provider_id": {
"name": "github_provider_id",
"gitlabId": {
"name": "gitlabId",
"type": "text",
"primaryKey": true,
"notNull": true
@ -3092,8 +3313,26 @@
"primaryKey": false,
"notNull": false
},
"application_secret": {
"name": "application_secret",
"redirect_uri": {
"name": "redirect_uri",
"type": "text",
"primaryKey": false,
"notNull": false
},
"secret": {
"name": "secret",
"type": "text",
"primaryKey": false,
"notNull": false
},
"access_token": {
"name": "access_token",
"type": "text",
"primaryKey": false,
"notNull": false
},
"refresh_token": {
"name": "refresh_token",
"type": "text",
"primaryKey": false,
"notNull": false
@ -3104,6 +3343,12 @@
"primaryKey": false,
"notNull": false
},
"expires_at": {
"name": "expires_at",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"gitProviderId": {
"name": "gitProviderId",
"type": "text",
@ -3113,9 +3358,9 @@
},
"indexes": {},
"foreignKeys": {
"gitlab_provider_gitProviderId_git_provider_gitProviderId_fk": {
"name": "gitlab_provider_gitProviderId_git_provider_gitProviderId_fk",
"tableFrom": "gitlab_provider",
"gitlab_gitProviderId_git_provider_gitProviderId_fk": {
"name": "gitlab_gitProviderId_git_provider_gitProviderId_fk",
"tableFrom": "gitlab",
"tableTo": "git_provider",
"columnsFrom": [
"gitProviderId"
@ -3150,6 +3395,8 @@
"docker",
"git",
"github",
"gitlab",
"bitbucket",
"drop"
]
},
@ -3250,6 +3497,8 @@
"values": [
"git",
"github",
"gitlab",
"bitbucket",
"raw"
]
},

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -236,162 +236,8 @@
{
"idx": 33,
"version": "6",
"when": 1725143717048,
"tag": "0033_polite_vulture",
"breakpoints": true
},
{
"idx": 34,
"version": "6",
"when": 1725144512654,
"tag": "0034_keen_dark_phoenix",
"breakpoints": true
},
{
"idx": 35,
"version": "6",
"when": 1725145310771,
"tag": "0035_crazy_misty_knight",
"breakpoints": true
},
{
"idx": 36,
"version": "6",
"when": 1725151725193,
"tag": "0036_faulty_wolverine",
"breakpoints": true
},
{
"idx": 37,
"version": "6",
"when": 1725152188339,
"tag": "0037_busy_the_fury",
"breakpoints": true
},
{
"idx": 38,
"version": "6",
"when": 1725154857832,
"tag": "0038_eminent_spiral",
"breakpoints": true
},
{
"idx": 39,
"version": "6",
"when": 1725155725647,
"tag": "0039_wakeful_starbolt",
"breakpoints": true
},
{
"idx": 40,
"version": "6",
"when": 1725156536999,
"tag": "0040_yummy_gambit",
"breakpoints": true
},
{
"idx": 41,
"version": "6",
"when": 1725157793284,
"tag": "0041_tranquil_may_parker",
"breakpoints": true
},
{
"idx": 42,
"version": "6",
"when": 1725158531995,
"tag": "0042_blue_vindicator",
"breakpoints": true
},
{
"idx": 43,
"version": "6",
"when": 1725158814900,
"tag": "0043_daily_proemial_gods",
"breakpoints": true
},
{
"idx": 44,
"version": "6",
"when": 1725160501885,
"tag": "0044_wide_human_torch",
"breakpoints": true
},
{
"idx": 45,
"version": "6",
"when": 1725162377005,
"tag": "0045_dazzling_liz_osborn",
"breakpoints": true
},
{
"idx": 46,
"version": "6",
"when": 1725168434474,
"tag": "0046_wonderful_oracle",
"breakpoints": true
},
{
"idx": 47,
"version": "6",
"when": 1725172770448,
"tag": "0047_optimal_peter_quill",
"breakpoints": true
},
{
"idx": 48,
"version": "6",
"when": 1725206119154,
"tag": "0048_unknown_radioactive_man",
"breakpoints": true
},
{
"idx": 49,
"version": "6",
"when": 1725225552834,
"tag": "0049_futuristic_vampiro",
"breakpoints": true
},
{
"idx": 50,
"version": "6",
"when": 1725226430293,
"tag": "0050_faithful_brood",
"breakpoints": true
},
{
"idx": 51,
"version": "6",
"when": 1725231466293,
"tag": "0051_powerful_ironclad",
"breakpoints": true
},
{
"idx": 52,
"version": "6",
"when": 1725231697187,
"tag": "0052_condemned_khan",
"breakpoints": true
},
{
"idx": 53,
"version": "6",
"when": 1725232936525,
"tag": "0053_fearless_electro",
"breakpoints": true
},
{
"idx": 54,
"version": "6",
"when": 1725238308102,
"tag": "0054_short_hellfire_club",
"breakpoints": true
},
{
"idx": 55,
"version": "6",
"when": 1725240886749,
"tag": "0055_nice_king_cobra",
"when": 1725250322137,
"tag": "0033_white_hawkeye",
"breakpoints": true
}
]