Getting there
This commit is contained in:
parent
2c94fe0cab
commit
d2dd00c8d4
14 changed files with 354 additions and 15 deletions
0
project/migrations/.gitkeep
Normal file
0
project/migrations/.gitkeep
Normal file
1
project/migrations/2020-03-24-142210_users/down.sql
Normal file
1
project/migrations/2020-03-24-142210_users/down.sql
Normal file
|
@ -0,0 +1 @@
|
|||
DROP TABLE users;
|
8
project/migrations/2020-03-24-142210_users/src/schema.rs
Normal file
8
project/migrations/2020-03-24-142210_users/src/schema.rs
Normal file
|
@ -0,0 +1,8 @@
|
|||
table! {
|
||||
users (id) {
|
||||
id -> Integer,
|
||||
username -> Varchar,
|
||||
is_admin -> Bool,
|
||||
password_hash -> Varchar,
|
||||
}
|
||||
}
|
7
project/migrations/2020-03-24-142210_users/up.sql
Normal file
7
project/migrations/2020-03-24-142210_users/up.sql
Normal file
|
@ -0,0 +1,7 @@
|
|||
CREATE TABLE users (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`username` varchar(100) NOT NULL,
|
||||
`is_admin` boolean NOT NULL,
|
||||
`password_hash` varchar(128) NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
Loading…
Add table
Add a link
Reference in a new issue