-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
69b2d2e
commit 4d5ed8a
Showing
10 changed files
with
522 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,28 @@ | ||
CREATE TABLE short_link_paste ( | ||
CREATE TABLE `short_link_paste` ( | ||
`short_link_id` text PRIMARY KEY NOT NULL, | ||
`code` text NOT NULL, | ||
`language` text, | ||
FOREIGN KEY (`short_link_id`) REFERENCES short_link(`id`) | ||
FOREIGN KEY (`short_link_id`) REFERENCES `short_link`(`id`) ON UPDATE no action ON DELETE no action | ||
); | ||
|
||
CREATE TABLE short_link_upload ( | ||
--> statement-breakpoint | ||
CREATE TABLE `short_link_upload` ( | ||
`short_link_id` text PRIMARY KEY NOT NULL, | ||
`filename` text NOT NULL, | ||
`size` integer NOT NULL, | ||
`hash` text NOT NULL, | ||
FOREIGN KEY (`short_link_id`) REFERENCES short_link(`id`) | ||
FOREIGN KEY (`short_link_id`) REFERENCES `short_link`(`id`) ON UPDATE no action ON DELETE no action | ||
); | ||
|
||
CREATE TABLE short_link_url ( | ||
--> statement-breakpoint | ||
CREATE TABLE `short_link_url` ( | ||
`short_link_id` text PRIMARY KEY NOT NULL, | ||
`url` text NOT NULL, | ||
FOREIGN KEY (`short_link_id`) REFERENCES short_link(`id`) | ||
FOREIGN KEY (`short_link_id`) REFERENCES `short_link`(`id`) ON UPDATE no action ON DELETE no action | ||
); | ||
|
||
CREATE TABLE short_link ( | ||
--> statement-breakpoint | ||
CREATE TABLE `short_link` ( | ||
`id` text PRIMARY KEY NOT NULL, | ||
`created_at` integer DEFAULT (cast((julianday('now') - 2440587.5)*86400000 as integer)) NOT NULL, | ||
`updated_at` integer DEFAULT (cast((julianday('now') - 2440587.5)*86400000 as integer)) NOT NULL, | ||
`created_at` integer DEFAULT CURRENT_TIMESTAMP NOT NULL, | ||
`updated_at` integer DEFAULT CURRENT_TIMESTAMP NOT NULL, | ||
`expires_at` integer, | ||
`type` text NOT NULL | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ALTER TABLE short_link ADD `delete_token` text(128); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,192 @@ | ||
{ | ||
"version": "5", | ||
"dialect": "sqlite", | ||
"id": "5c571eee-f9a2-498e-b1a7-6043b91b9b2b", | ||
"prevId": "00000000-0000-0000-0000-000000000000", | ||
"tables": { | ||
"short_link_paste": { | ||
"name": "short_link_paste", | ||
"columns": { | ||
"short_link_id": { | ||
"name": "short_link_id", | ||
"type": "text", | ||
"primaryKey": true, | ||
"notNull": true, | ||
"autoincrement": false | ||
}, | ||
"code": { | ||
"name": "code", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true, | ||
"autoincrement": false | ||
}, | ||
"language": { | ||
"name": "language", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": false, | ||
"autoincrement": false | ||
} | ||
}, | ||
"indexes": {}, | ||
"foreignKeys": { | ||
"short_link_paste_short_link_id_short_link_id_fk": { | ||
"name": "short_link_paste_short_link_id_short_link_id_fk", | ||
"tableFrom": "short_link_paste", | ||
"tableTo": "short_link", | ||
"columnsFrom": [ | ||
"short_link_id" | ||
], | ||
"columnsTo": [ | ||
"id" | ||
], | ||
"onDelete": "no action", | ||
"onUpdate": "no action" | ||
} | ||
}, | ||
"compositePrimaryKeys": {}, | ||
"uniqueConstraints": {} | ||
}, | ||
"short_link_upload": { | ||
"name": "short_link_upload", | ||
"columns": { | ||
"short_link_id": { | ||
"name": "short_link_id", | ||
"type": "text", | ||
"primaryKey": true, | ||
"notNull": true, | ||
"autoincrement": false | ||
}, | ||
"filename": { | ||
"name": "filename", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true, | ||
"autoincrement": false | ||
}, | ||
"size": { | ||
"name": "size", | ||
"type": "integer", | ||
"primaryKey": false, | ||
"notNull": true, | ||
"autoincrement": false | ||
}, | ||
"hash": { | ||
"name": "hash", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true, | ||
"autoincrement": false | ||
} | ||
}, | ||
"indexes": {}, | ||
"foreignKeys": { | ||
"short_link_upload_short_link_id_short_link_id_fk": { | ||
"name": "short_link_upload_short_link_id_short_link_id_fk", | ||
"tableFrom": "short_link_upload", | ||
"tableTo": "short_link", | ||
"columnsFrom": [ | ||
"short_link_id" | ||
], | ||
"columnsTo": [ | ||
"id" | ||
], | ||
"onDelete": "no action", | ||
"onUpdate": "no action" | ||
} | ||
}, | ||
"compositePrimaryKeys": {}, | ||
"uniqueConstraints": {} | ||
}, | ||
"short_link_url": { | ||
"name": "short_link_url", | ||
"columns": { | ||
"short_link_id": { | ||
"name": "short_link_id", | ||
"type": "text", | ||
"primaryKey": true, | ||
"notNull": true, | ||
"autoincrement": false | ||
}, | ||
"url": { | ||
"name": "url", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true, | ||
"autoincrement": false | ||
} | ||
}, | ||
"indexes": {}, | ||
"foreignKeys": { | ||
"short_link_url_short_link_id_short_link_id_fk": { | ||
"name": "short_link_url_short_link_id_short_link_id_fk", | ||
"tableFrom": "short_link_url", | ||
"tableTo": "short_link", | ||
"columnsFrom": [ | ||
"short_link_id" | ||
], | ||
"columnsTo": [ | ||
"id" | ||
], | ||
"onDelete": "no action", | ||
"onUpdate": "no action" | ||
} | ||
}, | ||
"compositePrimaryKeys": {}, | ||
"uniqueConstraints": {} | ||
}, | ||
"short_link": { | ||
"name": "short_link", | ||
"columns": { | ||
"id": { | ||
"name": "id", | ||
"type": "text", | ||
"primaryKey": true, | ||
"notNull": true, | ||
"autoincrement": false | ||
}, | ||
"created_at": { | ||
"name": "created_at", | ||
"type": "integer", | ||
"primaryKey": false, | ||
"notNull": true, | ||
"autoincrement": false, | ||
"default": "CURRENT_TIMESTAMP" | ||
}, | ||
"updated_at": { | ||
"name": "updated_at", | ||
"type": "integer", | ||
"primaryKey": false, | ||
"notNull": true, | ||
"autoincrement": false, | ||
"default": "CURRENT_TIMESTAMP" | ||
}, | ||
"expires_at": { | ||
"name": "expires_at", | ||
"type": "integer", | ||
"primaryKey": false, | ||
"notNull": false, | ||
"autoincrement": false | ||
}, | ||
"type": { | ||
"name": "type", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true, | ||
"autoincrement": false | ||
} | ||
}, | ||
"indexes": {}, | ||
"foreignKeys": {}, | ||
"compositePrimaryKeys": {}, | ||
"uniqueConstraints": {} | ||
} | ||
}, | ||
"enums": {}, | ||
"_meta": { | ||
"schemas": {}, | ||
"tables": {}, | ||
"columns": {} | ||
} | ||
} |
Oops, something went wrong.