added playground and userroute
This commit is contained in:
@@ -9,6 +9,12 @@ CREATE TABLE `opinions` (
|
||||
`type` text
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE `phone_tokens` (
|
||||
`phone` text PRIMARY KEY NOT NULL,
|
||||
`token` text NOT NULL,
|
||||
`created_on` integer DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE `provinces` (
|
||||
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
`name` text NOT NULL
|
||||
@@ -16,21 +22,26 @@ CREATE TABLE `provinces` (
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE `users` (
|
||||
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
`name` text,
|
||||
`firstName` text NOT NULL,
|
||||
`lastName` text NOT NULL,
|
||||
`title` text NOT NULL,
|
||||
`phone` text NOT NULL,
|
||||
`email` text,
|
||||
`job` text,
|
||||
`education` text,
|
||||
`job` text NOT NULL,
|
||||
`education` text NOT NULL,
|
||||
`vision` text,
|
||||
`reason` text,
|
||||
`group_id` integer,
|
||||
FOREIGN KEY (`group_id`) REFERENCES `groups`(`id`) ON UPDATE no action ON DELETE no action
|
||||
`group_id` integer NOT NULL,
|
||||
`zone_id` integer NOT NULL,
|
||||
FOREIGN KEY (`group_id`) REFERENCES `groups`(`id`) ON UPDATE no action ON DELETE no action,
|
||||
FOREIGN KEY (`zone_id`) REFERENCES `zones`(`id`) ON UPDATE no action ON DELETE no action
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE `user_opinions` (
|
||||
`user_id` integer,
|
||||
`opinion_id` integer,
|
||||
`choice` text DEFAULT 'ignore',
|
||||
PRIMARY KEY(`opinion_id`, `user_id`),
|
||||
FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE no action,
|
||||
FOREIGN KEY (`opinion_id`) REFERENCES `opinions`(`id`) ON UPDATE no action ON DELETE no action
|
||||
);
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"version": "5",
|
||||
"dialect": "sqlite",
|
||||
"id": "71187b23-6b9a-4f78-9f3c-0af6fb035f1b",
|
||||
"id": "86633c77-c16c-46e0-92a5-f0e696d3276c",
|
||||
"prevId": "00000000-0000-0000-0000-000000000000",
|
||||
"tables": {
|
||||
"groups": {
|
||||
@@ -57,6 +57,37 @@
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {}
|
||||
},
|
||||
"phone_tokens": {
|
||||
"name": "phone_tokens",
|
||||
"columns": {
|
||||
"phone": {
|
||||
"name": "phone",
|
||||
"type": "text",
|
||||
"primaryKey": true,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"token": {
|
||||
"name": "token",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"created_on": {
|
||||
"name": "created_on",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false,
|
||||
"default": "CURRENT_TIMESTAMP"
|
||||
}
|
||||
},
|
||||
"indexes": {},
|
||||
"foreignKeys": {},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {}
|
||||
},
|
||||
"provinces": {
|
||||
"name": "provinces",
|
||||
"columns": {
|
||||
@@ -90,11 +121,25 @@
|
||||
"notNull": true,
|
||||
"autoincrement": true
|
||||
},
|
||||
"name": {
|
||||
"name": "name",
|
||||
"firstName": {
|
||||
"name": "firstName",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"lastName": {
|
||||
"name": "lastName",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"title": {
|
||||
"name": "title",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"phone": {
|
||||
@@ -115,14 +160,14 @@
|
||||
"name": "job",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"education": {
|
||||
"name": "education",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"vision": {
|
||||
@@ -143,7 +188,14 @@
|
||||
"name": "group_id",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"zone_id": {
|
||||
"name": "zone_id",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
}
|
||||
},
|
||||
@@ -169,6 +221,19 @@
|
||||
],
|
||||
"onDelete": "no action",
|
||||
"onUpdate": "no action"
|
||||
},
|
||||
"users_zone_id_zones_id_fk": {
|
||||
"name": "users_zone_id_zones_id_fk",
|
||||
"tableFrom": "users",
|
||||
"tableTo": "zones",
|
||||
"columnsFrom": [
|
||||
"zone_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "no action",
|
||||
"onUpdate": "no action"
|
||||
}
|
||||
},
|
||||
"compositePrimaryKeys": {},
|
||||
@@ -229,7 +294,15 @@
|
||||
"onUpdate": "no action"
|
||||
}
|
||||
},
|
||||
"compositePrimaryKeys": {},
|
||||
"compositePrimaryKeys": {
|
||||
"user_opinions_user_id_opinion_id_pk": {
|
||||
"columns": [
|
||||
"opinion_id",
|
||||
"user_id"
|
||||
],
|
||||
"name": "user_opinions_user_id_opinion_id_pk"
|
||||
}
|
||||
},
|
||||
"uniqueConstraints": {}
|
||||
},
|
||||
"zones": {
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
{
|
||||
"idx": 0,
|
||||
"version": "5",
|
||||
"when": 1713465576653,
|
||||
"tag": "0000_aspiring_paibok",
|
||||
"when": 1713506374595,
|
||||
"tag": "0000_hot_gressill",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user