-
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
85c9f8c
commit f9552a4
Showing
4 changed files
with
243 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
DO $$ BEGIN | ||
CREATE TYPE "operation" AS ENUM('add', 'remove'); | ||
EXCEPTION | ||
WHEN duplicate_object THEN null; | ||
END $$; | ||
--> statement-breakpoint | ||
CREATE TABLE IF NOT EXISTS "history" ( | ||
"timestamp" timestamp with time zone DEFAULT now(), | ||
"name" varchar(300), | ||
"operation" "operation" | ||
); |
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,223 @@ | ||
{ | ||
"version": "5", | ||
"dialect": "pg", | ||
"id": "66e5bc34-5d69-4b44-91a4-0ed6da483fdf", | ||
"prevId": "4780e125-800d-40cd-850b-625bf52ebc1e", | ||
"tables": { | ||
"history": { | ||
"name": "history", | ||
"schema": "", | ||
"columns": { | ||
"timestamp": { | ||
"name": "timestamp", | ||
"type": "timestamp with time zone", | ||
"primaryKey": false, | ||
"notNull": false, | ||
"default": "now()" | ||
}, | ||
"name": { | ||
"name": "name", | ||
"type": "varchar(300)", | ||
"primaryKey": false, | ||
"notNull": false | ||
}, | ||
"operation": { | ||
"name": "operation", | ||
"type": "operation", | ||
"primaryKey": false, | ||
"notNull": false | ||
} | ||
}, | ||
"indexes": {}, | ||
"foreignKeys": {}, | ||
"compositePrimaryKeys": {}, | ||
"uniqueConstraints": {} | ||
}, | ||
"invite": { | ||
"name": "invite", | ||
"schema": "", | ||
"columns": { | ||
"id": { | ||
"name": "id", | ||
"type": "varchar(255)", | ||
"primaryKey": true, | ||
"notNull": true | ||
}, | ||
"expires": { | ||
"name": "expires", | ||
"type": "bigint", | ||
"primaryKey": false, | ||
"notNull": true | ||
} | ||
}, | ||
"indexes": {}, | ||
"foreignKeys": {}, | ||
"compositePrimaryKeys": {}, | ||
"uniqueConstraints": {} | ||
}, | ||
"user_key": { | ||
"name": "user_key", | ||
"schema": "", | ||
"columns": { | ||
"id": { | ||
"name": "id", | ||
"type": "varchar(255)", | ||
"primaryKey": true, | ||
"notNull": true | ||
}, | ||
"user_id": { | ||
"name": "user_id", | ||
"type": "varchar(15)", | ||
"primaryKey": false, | ||
"notNull": true | ||
}, | ||
"hashed_password": { | ||
"name": "hashed_password", | ||
"type": "varchar(255)", | ||
"primaryKey": false, | ||
"notNull": false | ||
} | ||
}, | ||
"indexes": {}, | ||
"foreignKeys": { | ||
"user_key_user_id_auth_user_id_fk": { | ||
"name": "user_key_user_id_auth_user_id_fk", | ||
"tableFrom": "user_key", | ||
"tableTo": "auth_user", | ||
"columnsFrom": [ | ||
"user_id" | ||
], | ||
"columnsTo": [ | ||
"id" | ||
], | ||
"onDelete": "no action", | ||
"onUpdate": "no action" | ||
} | ||
}, | ||
"compositePrimaryKeys": {}, | ||
"uniqueConstraints": {} | ||
}, | ||
"user_session": { | ||
"name": "user_session", | ||
"schema": "", | ||
"columns": { | ||
"id": { | ||
"name": "id", | ||
"type": "varchar(128)", | ||
"primaryKey": true, | ||
"notNull": true | ||
}, | ||
"user_id": { | ||
"name": "user_id", | ||
"type": "varchar(15)", | ||
"primaryKey": false, | ||
"notNull": true | ||
}, | ||
"active_expires": { | ||
"name": "active_expires", | ||
"type": "bigint", | ||
"primaryKey": false, | ||
"notNull": true | ||
}, | ||
"idle_expires": { | ||
"name": "idle_expires", | ||
"type": "bigint", | ||
"primaryKey": false, | ||
"notNull": true | ||
} | ||
}, | ||
"indexes": {}, | ||
"foreignKeys": { | ||
"user_session_user_id_auth_user_id_fk": { | ||
"name": "user_session_user_id_auth_user_id_fk", | ||
"tableFrom": "user_session", | ||
"tableTo": "auth_user", | ||
"columnsFrom": [ | ||
"user_id" | ||
], | ||
"columnsTo": [ | ||
"id" | ||
], | ||
"onDelete": "no action", | ||
"onUpdate": "no action" | ||
} | ||
}, | ||
"compositePrimaryKeys": {}, | ||
"uniqueConstraints": {} | ||
}, | ||
"shopping_list": { | ||
"name": "shopping_list", | ||
"schema": "", | ||
"columns": { | ||
"id": { | ||
"name": "id", | ||
"type": "varchar(15)", | ||
"primaryKey": true, | ||
"notNull": true | ||
}, | ||
"name": { | ||
"name": "name", | ||
"type": "varchar(300)", | ||
"primaryKey": false, | ||
"notNull": false | ||
} | ||
}, | ||
"indexes": {}, | ||
"foreignKeys": {}, | ||
"compositePrimaryKeys": {}, | ||
"uniqueConstraints": {} | ||
}, | ||
"auth_user": { | ||
"name": "auth_user", | ||
"schema": "", | ||
"columns": { | ||
"id": { | ||
"name": "id", | ||
"type": "varchar(15)", | ||
"primaryKey": true, | ||
"notNull": true | ||
}, | ||
"username": { | ||
"name": "username", | ||
"type": "varchar(31)", | ||
"primaryKey": false, | ||
"notNull": true | ||
}, | ||
"isAdmin": { | ||
"name": "isAdmin", | ||
"type": "boolean", | ||
"primaryKey": false, | ||
"notNull": true, | ||
"default": false | ||
} | ||
}, | ||
"indexes": {}, | ||
"foreignKeys": {}, | ||
"compositePrimaryKeys": {}, | ||
"uniqueConstraints": { | ||
"auth_user_username_unique": { | ||
"name": "auth_user_username_unique", | ||
"nullsNotDistinct": false, | ||
"columns": [ | ||
"username" | ||
] | ||
} | ||
} | ||
} | ||
}, | ||
"enums": { | ||
"operation": { | ||
"name": "operation", | ||
"values": { | ||
"add": "add", | ||
"remove": "remove" | ||
} | ||
} | ||
}, | ||
"schemas": {}, | ||
"_meta": { | ||
"schemas": {}, | ||
"tables": {}, | ||
"columns": {} | ||
} | ||
} |
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
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