* renamed users schema to members basically and added foreign key ref to keys schema
This commit is contained in:
parent
9c4323c0c5
commit
112c9f34cd
@ -1,2 +0,0 @@
|
||||
-- This file should undo anything in `up.sql`
|
||||
DROP TABLE `users`;
|
@ -1,12 +0,0 @@
|
||||
-- id: simple id tracking users
|
||||
-- name: default name that users have to display
|
||||
-- date: date that they signed up
|
||||
-- status: online/offline/away etc.
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `users` (
|
||||
`id` bigint UNSIGNED NOT NULL auto_increment,
|
||||
`name` varchar(255) NOT NULL,
|
||||
`date` bigint UNSIGNED NOT NULL,
|
||||
`status` integer NOT NULL,
|
||||
PRIMARY KEY( `id` )
|
||||
);
|
@ -8,5 +8,5 @@ CREATE TABLE IF NOT EXISTS `keys`(
|
||||
`uses` integer,
|
||||
`userid` bigint unsigned NOT NULL,
|
||||
PRIMARY KEY(`secret`),
|
||||
FOREIGN KEY `userid` REFERENCES users(`id`)
|
||||
);
|
||||
FOREIGN KEY (`userid`) REFERENCES members(`id`)
|
||||
);
|
||||
|
1
server/migrations/2020-07-05-215114_members/down.sql
Normal file
1
server/migrations/2020-07-05-215114_members/down.sql
Normal file
@ -0,0 +1 @@
|
||||
DROP TABLE `members`;
|
7
server/migrations/2020-07-05-215114_members/up.sql
Normal file
7
server/migrations/2020-07-05-215114_members/up.sql
Normal file
@ -0,0 +1,7 @@
|
||||
CREATE TABLE IF NOT EXISTS `members`(
|
||||
`id` bigint UNSIGNED NOT NULL auto_increment,
|
||||
`name` varchar(255) NOT NULL,
|
||||
`joindate` bigint UNSIGNED NOT NULL,
|
||||
`status` integer NOT NULL,
|
||||
PRIMARY KEY( `id` )
|
||||
);
|
Loading…
Reference in New Issue
Block a user