Renaming project to json-api for clarity sake
This commit is contained in:
0
json-api/migrations/.gitkeep
Normal file
0
json-api/migrations/.gitkeep
Normal file
2
json-api/migrations/2020-02-04-083657_invites/down.sql
Normal file
2
json-api/migrations/2020-02-04-083657_invites/down.sql
Normal file
@@ -0,0 +1,2 @@
|
||||
-- This file should undo anything in `up.sql`
|
||||
DROP TABLE `invites`;
|
||||
12
json-api/migrations/2020-02-04-083657_invites/up.sql
Normal file
12
json-api/migrations/2020-02-04-083657_invites/up.sql
Normal file
@@ -0,0 +1,12 @@
|
||||
-- @id : id of the invite which is also its kill date
|
||||
|
||||
-- @uses : can be null which means it doesn't have a use limit
|
||||
|
||||
-- @expires: boolean that tells wether the key expires or not
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `invites` (
|
||||
`id` BIGINT UNIQUE NOT NULL,
|
||||
`uses` BIGINT,
|
||||
`expires` BOOLEAN NOT NULL,
|
||||
PRIMARY KEY( `id` )
|
||||
);
|
||||
2
json-api/migrations/2020-03-11-005217_channels/down.sql
Normal file
2
json-api/migrations/2020-03-11-005217_channels/down.sql
Normal file
@@ -0,0 +1,2 @@
|
||||
-- This file should undo anything in `up.sql`
|
||||
DROP TABLE `channels`;
|
||||
8
json-api/migrations/2020-03-11-005217_channels/up.sql
Normal file
8
json-api/migrations/2020-03-11-005217_channels/up.sql
Normal file
@@ -0,0 +1,8 @@
|
||||
-- TODO: somehow make the name colum unique
|
||||
CREATE TABLE IF NOT EXISTS `channels` (
|
||||
`id` BIGINT UNSIGNED NOT NULL auto_increment,
|
||||
`name` VARCHAR(255) NOT NULL,
|
||||
`description` VARCHAR(1024),
|
||||
`kind` INTEGER NOT NULL,
|
||||
PRIMARY KEY(`id`), UNIQUE KEY(`name`)
|
||||
);
|
||||
1
json-api/migrations/2020-07-05-215114_members/down.sql
Normal file
1
json-api/migrations/2020-07-05-215114_members/down.sql
Normal file
@@ -0,0 +1 @@
|
||||
DROP TABLE `members`;
|
||||
11
json-api/migrations/2020-07-05-215114_members/up.sql
Normal file
11
json-api/migrations/2020-07-05-215114_members/up.sql
Normal file
@@ -0,0 +1,11 @@
|
||||
-- TODO: add rate limiter in some form
|
||||
-- PERMISSIONS start at 0 and full perms => all F's
|
||||
CREATE TABLE IF NOT EXISTS `members`(
|
||||
`id` BIGINT UNSIGNED NOT NULL auto_increment,
|
||||
`secret` varchar(256) NOT NULL,
|
||||
`name` varchar(256) NOT NULL,
|
||||
`joindate` bigint NOT NULL,
|
||||
`status` integer NOT NULL,
|
||||
`permissions` bigint UNSIGNED NOT NULL,
|
||||
PRIMARY KEY( `id` , `secret` )
|
||||
);
|
||||
1
json-api/migrations/2020-07-06-022319_messages/down.sql
Normal file
1
json-api/migrations/2020-07-06-022319_messages/down.sql
Normal file
@@ -0,0 +1 @@
|
||||
DROP TABLE `messages`;
|
||||
11
json-api/migrations/2020-07-06-022319_messages/up.sql
Normal file
11
json-api/migrations/2020-07-06-022319_messages/up.sql
Normal file
@@ -0,0 +1,11 @@
|
||||
-- Time stamp is _not_ in ms
|
||||
CREATE TABLE IF NOT EXISTS `messages`(
|
||||
`id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`time` BIGINT NOT NULL,
|
||||
`content` VARCHAR(2048) NOT NULL,
|
||||
`author_id` BIGINT UNSIGNED NOT NULL,
|
||||
`channel_id` BIGINT UNSIGNED NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
FOREIGN KEY (`author_id`) REFERENCES members(`id`),
|
||||
FOREIGN KEY (`channel_id`) REFERENCES channels(`id`) ON DELETE CASCADE
|
||||
);
|
||||
2
json-api/migrations/2020-12-29-030934_jwt/down.sql
Normal file
2
json-api/migrations/2020-12-29-030934_jwt/down.sql
Normal file
@@ -0,0 +1,2 @@
|
||||
-- This file should undo anything in `up.sql`
|
||||
DROP TABLE `jwt`;
|
||||
5
json-api/migrations/2020-12-29-030934_jwt/up.sql
Normal file
5
json-api/migrations/2020-12-29-030934_jwt/up.sql
Normal file
@@ -0,0 +1,5 @@
|
||||
CREATE TABLE IF NOT EXISTS `jwt`(
|
||||
`id` BIGINT UNSIGNED NOT NULL,
|
||||
`token` VARCHAR(256) NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
);
|
||||
Reference in New Issue
Block a user