24 lines
1019 B
Rust
24 lines
1019 B
Rust
//! Migration: add public_notes to Visit
|
|||
|
|
|
||
|
|
#[derive(Debug, Copy, Clone)]
|
||
|
|
pub(super) struct Migration;
|
||
|
|
impl ::cot::db::migrations::Migration for Migration {
|
||
|
|
const APP_NAME: &'static str = "web-petting";
|
||
|
|
const MIGRATION_NAME: &'static str = "m_0004_visit_public_notes";
|
||
|
|
const DEPENDENCIES: &'static [::cot::db::migrations::MigrationDependency] = &[
|
||
|
|
::cot::db::migrations::MigrationDependency::migration("web-petting", "m_0003_visit_feedback"),
|
||
|
|
];
|
||
|
|
const OPERATIONS: &'static [::cot::db::migrations::Operation] = &[
|
||
|
|
::cot::db::migrations::Operation::add_field()
|
||
|
|
.table_name(::cot::db::Identifier::new("web_petting__visit"))
|
||
|
|
.field(
|
||
|
|
::cot::db::migrations::Field::new(
|
||
|
|
::cot::db::Identifier::new("public_notes"),
|
||
|
|
<Option<String> as ::cot::db::DatabaseField>::TYPE,
|
||
|
|
)
|
||
|
|
.set_null(<Option<String> as ::cot::db::DatabaseField>::NULLABLE)
|
||
|
|
)
|
||
|
|
.build(),
|
||
|
|
];
|
||
|
|
}
|