feat: Add multi-repository support for script synchronization
- Add Repository model to Prisma schema with migration - Create repositoryService for managing repositories - Add repositories API router with CRUD operations - Update GitHubJsonService to support multiple repositories - Update ScriptDownloaderService to use repository URL from scripts - Add repository_url field to Script and ScriptCard types - Add repository management UI tab to GeneralSettingsModal - Display repository source on script cards and detail modal - Implement repository deletion with JSON file cleanup - Initialize default repositories (main and dev) on server startup
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
-- CreateTable
|
||||
CREATE TABLE "repositories" (
|
||||
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||
"url" TEXT NOT NULL,
|
||||
"enabled" BOOLEAN NOT NULL DEFAULT true,
|
||||
"is_default" BOOLEAN NOT NULL DEFAULT false,
|
||||
"is_removable" BOOLEAN NOT NULL DEFAULT true,
|
||||
"priority" INTEGER NOT NULL DEFAULT 0,
|
||||
"created_at" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updated_at" DATETIME NOT NULL
|
||||
);
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "repositories_url_key" ON "repositories"("url");
|
||||
@@ -95,3 +95,16 @@ model LXCConfig {
|
||||
|
||||
@@map("lxc_configs")
|
||||
}
|
||||
|
||||
model Repository {
|
||||
id Int @id @default(autoincrement())
|
||||
url String @unique
|
||||
enabled Boolean @default(true)
|
||||
is_default Boolean @default(false)
|
||||
is_removable Boolean @default(true)
|
||||
priority Int @default(0)
|
||||
created_at DateTime @default(now())
|
||||
updated_at DateTime @updatedAt
|
||||
|
||||
@@map("repositories")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user