feat: add site setting
This commit is contained in:
parent
b7c4a6bcb5
commit
5f10efa6d7
@ -1,5 +1,6 @@
|
|||||||
-- Your SQL goes here
|
-- Your SQL goes here
|
||||||
CREATE TABLE "public"."setting" (
|
CREATE TABLE "public"."setting" (
|
||||||
"name" varchar NOT NULL,
|
"name" varchar NOT NULL,
|
||||||
"value" varchar
|
"value" text,
|
||||||
|
PRIMARY KEY ("name")
|
||||||
);
|
);
|
1
migrations/2018-10-23-071346_add setting/down.sql
Normal file
1
migrations/2018-10-23-071346_add setting/down.sql
Normal file
@ -0,0 +1 @@
|
|||||||
|
-- This file should undo anything in `up.sql`
|
3
migrations/2018-10-23-071346_add setting/up.sql
Normal file
3
migrations/2018-10-23-071346_add setting/up.sql
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
-- Your SQL goes here
|
||||||
|
INSERT INTO setting ("name", "value")
|
||||||
|
VALUES ('title', 'rubble'), ('description', 'description of rubble application');
|
@ -93,3 +93,9 @@ impl User {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Queryable, Debug, Seriable, Insertable, AsChangeset)]
|
||||||
|
pub struct Setting {
|
||||||
|
pub name: String,
|
||||||
|
pub value: Option<String>,
|
||||||
|
}
|
||||||
|
@ -10,6 +10,13 @@ table! {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
table! {
|
||||||
|
setting (name) {
|
||||||
|
name -> Varchar,
|
||||||
|
value -> Nullable<Text>,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
table! {
|
table! {
|
||||||
users (id) {
|
users (id) {
|
||||||
id -> Int4,
|
id -> Int4,
|
||||||
@ -24,5 +31,6 @@ joinable!(articles -> users (user_id));
|
|||||||
|
|
||||||
allow_tables_to_appear_in_same_query!(
|
allow_tables_to_appear_in_same_query!(
|
||||||
articles,
|
articles,
|
||||||
|
setting,
|
||||||
users,
|
users,
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user