create table literals
This commit is contained in:
parent
f992a99bd4
commit
f5deffc3b3
1
migrations/2025-04-03-134446_token_map/down.sql
Normal file
1
migrations/2025-04-03-134446_token_map/down.sql
Normal file
@ -0,0 +1 @@
|
|||||||
|
DROP TABLE IF EXISTS literals;
|
||||||
5
migrations/2025-04-03-134446_token_map/up.sql
Normal file
5
migrations/2025-04-03-134446_token_map/up.sql
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
CREATE TABLE literals (
|
||||||
|
id SERIAL PRIMARY KEY,
|
||||||
|
token VARCHAR(255) UNIQUE NOT NULL,
|
||||||
|
value TEXT
|
||||||
|
);
|
||||||
@ -5,6 +5,14 @@
|
|||||||
|
|
||||||
|
|
||||||
use diesel::prelude::*;
|
use diesel::prelude::*;
|
||||||
|
#[derive(Queryable, Debug)]
|
||||||
|
#[diesel(table_name = literals)]
|
||||||
|
pub struct Literal {
|
||||||
|
pub id: i32,
|
||||||
|
pub token: String,
|
||||||
|
pub value: Option<String>,
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Queryable, Debug)]
|
#[derive(Queryable, Debug)]
|
||||||
#[diesel(table_name = messages)]
|
#[diesel(table_name = messages)]
|
||||||
pub struct Message {
|
pub struct Message {
|
||||||
|
|||||||
@ -1,5 +1,14 @@
|
|||||||
// @generated automatically by Diesel CLI.
|
// @generated automatically by Diesel CLI.
|
||||||
|
|
||||||
|
diesel::table! {
|
||||||
|
literals (id) {
|
||||||
|
id -> Int4,
|
||||||
|
#[max_length = 255]
|
||||||
|
token -> Varchar,
|
||||||
|
value -> Nullable<Text>,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
diesel::table! {
|
diesel::table! {
|
||||||
messages (id) {
|
messages (id) {
|
||||||
id -> Int4,
|
id -> Int4,
|
||||||
@ -18,6 +27,7 @@ diesel::table! {
|
|||||||
}
|
}
|
||||||
|
|
||||||
diesel::allow_tables_to_appear_in_same_query!(
|
diesel::allow_tables_to_appear_in_same_query!(
|
||||||
|
literals,
|
||||||
messages,
|
messages,
|
||||||
users,
|
users,
|
||||||
);
|
);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user