Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sd resources page #5

Merged
merged 11 commits into from
Jul 17, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ CREATE TABLE `vaults` (
`id` text PRIMARY KEY NOT NULL,
`name` text,
`path` text NOT NULL,
`createdAt` integer DEFAULT 1718055782029 NOT NULL,
`createdAt` integer DEFAULT 1721067822749 NOT NULL,
`has_installed_sd` integer DEFAULT 0 NOT NULL
);
121 changes: 62 additions & 59 deletions backend/migrations/master/meta/0000_snapshot.json
Original file line number Diff line number Diff line change
@@ -1,60 +1,63 @@
{
"version": "5",
"dialect": "sqlite",
"id": "3389e9af-0dac-4d76-b173-b1b3ea9d68a1",
"prevId": "00000000-0000-0000-0000-000000000000",
"tables": {
"vaults": {
"name": "vaults",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"path": {
"name": "path",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"createdAt": {
"name": "createdAt",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": 1718055782029
},
"has_installed_sd": {
"name": "has_installed_sd",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": 0
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
}
},
"enums": {},
"_meta": {
"schemas": {},
"tables": {},
"columns": {}
}
}
"version": "6",
"dialect": "sqlite",
"id": "a5833e65-0fce-4b15-8891-7cbf1ff33ce3",
"prevId": "00000000-0000-0000-0000-000000000000",
"tables": {
"vaults": {
"name": "vaults",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"path": {
"name": "path",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"createdAt": {
"name": "createdAt",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": 1721067822749
},
"has_installed_sd": {
"name": "has_installed_sd",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": 0
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
}
},
"enums": {},
"_meta": {
"schemas": {},
"tables": {},
"columns": {}
},
"internal": {
"indexes": {}
}
}
24 changes: 12 additions & 12 deletions backend/migrations/master/meta/_journal.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"version": "5",
"dialect": "sqlite",
"entries": [
{
"idx": 0,
"version": "5",
"when": 1718055782032,
"tag": "0000_ancient_vermin",
"breakpoints": true
}
]
}
"version": "7",
"dialect": "sqlite",
"entries": [
{
"idx": 0,
"version": "6",
"when": 1721067822751,
"tag": "0000_adorable_satana",
"breakpoints": true
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ CREATE TABLE `media_items` (
`created_at` integer NOT NULL,
`updated_at` integer,
`is_archived` integer DEFAULT 0 NOT NULL,
`exif` text
`exif` text,
`sd_checkpoint` text,
FOREIGN KEY (`sd_checkpoint`) REFERENCES `sd_checkpoints`(`id`) ON UPDATE no action ON DELETE no action
);
--> statement-breakpoint
CREATE TABLE `playlists` (
Expand All @@ -36,11 +38,26 @@ CREATE TABLE `playlists_media_items` (
FOREIGN KEY (`media_item_id`) REFERENCES `media_items`(`id`) ON UPDATE no action ON DELETE cascade
);
--> statement-breakpoint
CREATE TABLE `sd_checkpoints` (
`id` text PRIMARY KEY NOT NULL,
`name` text NOT NULL,
`path` text NOT NULL,
`description` text,
`origin` text NOT NULL,
`sd_version` text NOT NULL,
`sha256` text NOT NULL,
`preview_image` text
);
--> statement-breakpoint
CREATE TABLE `sd_loras` (
`id` text PRIMARY KEY NOT NULL,
`name` text NOT NULL,
`path` text NOT NULL,
`description` text,
`metadata` text,
`preview_image` text,
`origin` text NOT NULL,
`sd_version` text NOT NULL,
`activation_words` text NOT NULL
);
--> statement-breakpoint
Expand Down
118 changes: 116 additions & 2 deletions backend/migrations/vault/meta/0000_snapshot.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": "6",
"dialect": "sqlite",
"id": "bd1b0c36-eb14-43e7-97a3-9d34be889216",
"id": "d7b5460b-3d98-4af2-9846-37d39463e6c5",
"prevId": "00000000-0000-0000-0000-000000000000",
"tables": {
"loras_to_mediaItems": {
Expand Down Expand Up @@ -128,10 +128,31 @@
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"sd_checkpoint": {
"name": "sd_checkpoint",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {},
"foreignKeys": {
"media_items_sd_checkpoint_sd_checkpoints_id_fk": {
"name": "media_items_sd_checkpoint_sd_checkpoints_id_fk",
"tableFrom": "media_items",
"tableTo": "sd_checkpoints",
"columnsFrom": [
"sd_checkpoint"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
},
Expand Down Expand Up @@ -253,6 +274,71 @@
},
"uniqueConstraints": {}
},
"sd_checkpoints": {
"name": "sd_checkpoints",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"path": {
"name": "path",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"description": {
"name": "description",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"origin": {
"name": "origin",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"sd_version": {
"name": "sd_version",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"sha256": {
"name": "sha256",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"preview_image": {
"name": "preview_image",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
},
"sd_loras": {
"name": "sd_loras",
"columns": {
Expand All @@ -277,13 +363,41 @@
"notNull": true,
"autoincrement": false
},
"description": {
"name": "description",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"metadata": {
"name": "metadata",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"preview_image": {
"name": "preview_image",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"origin": {
"name": "origin",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"sd_version": {
"name": "sd_version",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"activation_words": {
"name": "activation_words",
"type": "text",
Expand Down
4 changes: 2 additions & 2 deletions backend/migrations/vault/meta/_journal.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
{
"idx": 0,
"version": "6",
"when": 1720124113173,
"tag": "0000_peaceful_triton",
"when": 1721067823068,
"tag": "0000_blushing_tomorrow_man",
"breakpoints": true
}
]
Expand Down
Loading