lulw just setting up database schemas via diesel

This commit is contained in:
shockrah committed 2019-12-08 21:28:31 -08:00
1 parent a765f8b9ff
commit 3d8d8f93b9
9 files changed
+46

No files matched your search

+1
View File
@@ -0,0 +1 @@
DATABASE_URL=mysql://freechat_server:@localhost/freechat_dev
+12
View File
@@ -0,0 +1,12 @@
[package]
name = "db_io"
version = "0.1.0"
authors = ["shockrah <alejandros714@protonmail.com>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
diesel = { version = "1.0.0", features = ["postgres"] }
dotenv = "0.9.0"
+5
View File
@@ -0,0 +1,5 @@
# For documentation on how to configure this file,
# see diesel.rs/guides/configuring-diesel-cli
[print_schema]
file = "src/schema.rs"
@@ -0,0 +1 @@
drop table users;
@@ -0,0 +1,6 @@
CREATE TABLE users (
id INTEGER PRIMARY KEY,
strid VARCHAR(256),
display VARCHAR(256),
native BOOLEAN
);
@@ -0,0 +1 @@
-- This file should undo anything in `up.sql`
@@ -0,0 +1,5 @@
CREATE TABLE channels (
id INTEGER PRIMARY KEY,
name VARCHAR(128) NOT NULL,
type INTEGER NOT NULL,
);
+7
View File
@@ -0,0 +1,7 @@
#[cfg(test)]
mod tests {
#[test]
fn it_works() {
assert_eq!(2 + 2, 4);
}
}
+8
View File
@@ -0,0 +1,8 @@
table! {
users (id) {
id -> Integer,
strid -> Nullable<Varchar>,
display -> Nullable<Varchar>,
native -> Nullable<Bool>,
}
}