core
: Add subject
column
This commit is contained in:
parent
0e7aacdd0e
commit
5078b41499
3 changed files with 8 additions and 0 deletions
|
@ -2,8 +2,14 @@ CREATE TABLE IF NOT EXISTS meta_subjects (
|
|||
id UUID DEFAULT gen_random_uuid(),
|
||||
document BPCHAR NOT NULL,
|
||||
pattern BPCHAR NOT NULL,
|
||||
subject BPCHAR,
|
||||
redirect BPCHAR,
|
||||
|
||||
CONSTRAINT either_subject_or_redirect_not_null CHECK (
|
||||
(subject IS NOT NULL AND redirect IS NULL)
|
||||
OR
|
||||
(subject IS NULL AND redirect IS NOT NULL)
|
||||
),
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@ pub struct MetaSubject {
|
|||
pub id: Uuid,
|
||||
pub document: String,
|
||||
pub pattern: String,
|
||||
pub subject: Option<String>,
|
||||
pub redirect: Option<String>,
|
||||
}
|
||||
|
||||
|
|
|
@ -55,6 +55,7 @@ diesel::table! {
|
|||
id -> Uuid,
|
||||
document -> Bpchar,
|
||||
pattern -> Bpchar,
|
||||
subject -> Nullable<Bpchar>,
|
||||
redirect -> Nullable<Bpchar>,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue