feat: enable hybrid local and remote module execution
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
CREATE TABLE "student_custom_module_repositories" (
|
||||
"id" UUID NOT NULL,
|
||||
"user_id" UUID NOT NULL,
|
||||
"custom_module_id" UUID NOT NULL,
|
||||
"repo_owner" TEXT NOT NULL,
|
||||
"repo_name" TEXT NOT NULL,
|
||||
"repository_url" TEXT NOT NULL,
|
||||
"created_at" TIMESTAMPTZ(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updated_at" TIMESTAMPTZ(3) NOT NULL,
|
||||
|
||||
CONSTRAINT "student_custom_module_repositories_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
CREATE TABLE "team_custom_module_repositories" (
|
||||
"id" UUID NOT NULL,
|
||||
"group_id" UUID NOT NULL,
|
||||
"custom_module_id" UUID NOT NULL,
|
||||
"repo_owner" TEXT NOT NULL,
|
||||
"repo_name" TEXT NOT NULL,
|
||||
"repository_url" TEXT NOT NULL,
|
||||
"created_at" TIMESTAMPTZ(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updated_at" TIMESTAMPTZ(3) NOT NULL,
|
||||
|
||||
CONSTRAINT "team_custom_module_repositories_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
CREATE UNIQUE INDEX "student_custom_module_repositories_custom_module_id_key" ON "student_custom_module_repositories"("custom_module_id");
|
||||
CREATE INDEX "student_custom_module_repositories_user_id_idx" ON "student_custom_module_repositories"("user_id");
|
||||
CREATE INDEX "student_custom_module_repositories_repo_owner_repo_name_idx" ON "student_custom_module_repositories"("repo_owner", "repo_name");
|
||||
CREATE UNIQUE INDEX "team_custom_module_repositories_custom_module_id_key" ON "team_custom_module_repositories"("custom_module_id");
|
||||
CREATE INDEX "team_custom_module_repositories_group_id_idx" ON "team_custom_module_repositories"("group_id");
|
||||
CREATE INDEX "team_custom_module_repositories_repo_owner_repo_name_idx" ON "team_custom_module_repositories"("repo_owner", "repo_name");
|
||||
|
||||
ALTER TABLE "student_custom_module_repositories"
|
||||
ADD CONSTRAINT "student_custom_module_repositories_user_id_fkey"
|
||||
FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
ALTER TABLE "student_custom_module_repositories"
|
||||
ADD CONSTRAINT "student_custom_module_repositories_custom_module_id_fkey"
|
||||
FOREIGN KEY ("custom_module_id") REFERENCES "student_custom_modules"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
ALTER TABLE "team_custom_module_repositories"
|
||||
ADD CONSTRAINT "team_custom_module_repositories_group_id_fkey"
|
||||
FOREIGN KEY ("group_id") REFERENCES "student_groups"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
ALTER TABLE "team_custom_module_repositories"
|
||||
ADD CONSTRAINT "team_custom_module_repositories_custom_module_id_fkey"
|
||||
FOREIGN KEY ("custom_module_id") REFERENCES "team_custom_modules"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
Reference in New Issue
Block a user