* renamed users schema to members basically and added foreign key ref to keys schema

This commit is contained in:
shockrah 2020-07-05 15:05:34 -07:00
parent 9c4323c0c5
commit 112c9f34cd
5 changed files with 10 additions and 16 deletions

View File

@ -1,2 +0,0 @@
-- This file should undo anything in `up.sql`
DROP TABLE `users`;

View File

@ -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` )
);

View File

@ -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`)
);

View File

@ -0,0 +1 @@
DROP TABLE `members`;

View 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` )
);