//! Initial PostgreSQL schema for the current data model. #[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_0001_initial"; const DEPENDENCIES: &'static [::cot::db::migrations::MigrationDependency] = &[]; const OPERATIONS: &'static [::cot::db::migrations::Operation] = &[ ::cot::db::migrations::Operation::create_model() .table_name(::cot::db::Identifier::new("web_petting__user")) .fields(&[ ::cot::db::migrations::Field::new( ::cot::db::Identifier::new("id"), as ::cot::db::DatabaseField>::TYPE, ) .auto() .primary_key() .set_null( as ::cot::db::DatabaseField>::NULLABLE), ::cot::db::migrations::Field::new( ::cot::db::Identifier::new("login"), ::TYPE, ) .set_null(::NULLABLE) .unique(), ::cot::db::migrations::Field::new( ::cot::db::Identifier::new("password_hash"), ::TYPE, ) .set_null(::NULLABLE), ::cot::db::migrations::Field::new( ::cot::db::Identifier::new("display_name"), as ::cot::db::DatabaseField>::TYPE, ) .set_null( as ::cot::db::DatabaseField>::NULLABLE), ::cot::db::migrations::Field::new( ::cot::db::Identifier::new("telegram_chat_id"), as ::cot::db::DatabaseField>::TYPE, ) .set_null( as ::cot::db::DatabaseField>::NULLABLE), ::cot::db::migrations::Field::new( ::cot::db::Identifier::new("telegram_notifications"), as ::cot::db::DatabaseField>::TYPE, ) .set_null( as ::cot::db::DatabaseField>::NULLABLE), ::cot::db::migrations::Field::new( ::cot::db::Identifier::new("status"), ::TYPE, ) .set_null(::NULLABLE), ::cot::db::migrations::Field::new( ::cot::db::Identifier::new("created_at"), ::TYPE, ) .set_null(::NULLABLE), ::cot::db::migrations::Field::new( ::cot::db::Identifier::new("updated_at"), ::TYPE, ) .set_null(::NULLABLE), ]) .build(), ::cot::db::migrations::Operation::create_model() .table_name(::cot::db::Identifier::new("web_petting__setting")) .fields(&[ ::cot::db::migrations::Field::new( ::cot::db::Identifier::new("id"), as ::cot::db::DatabaseField>::TYPE, ) .auto() .primary_key() .set_null( as ::cot::db::DatabaseField>::NULLABLE), ::cot::db::migrations::Field::new( ::cot::db::Identifier::new("key"), ::TYPE, ) .set_null(::NULLABLE) .unique(), ::cot::db::migrations::Field::new( ::cot::db::Identifier::new("value"), ::TYPE, ) .set_null(::NULLABLE), ::cot::db::migrations::Field::new( ::cot::db::Identifier::new("updated_at"), ::TYPE, ) .set_null(::NULLABLE), ]) .build(), ::cot::db::migrations::Operation::create_model() .table_name(::cot::db::Identifier::new("web_petting__client")) .fields(&[ ::cot::db::migrations::Field::new( ::cot::db::Identifier::new("id"), as ::cot::db::DatabaseField>::TYPE, ) .auto() .primary_key() .set_null( as ::cot::db::DatabaseField>::NULLABLE), ::cot::db::migrations::Field::new( ::cot::db::Identifier::new("name"), ::TYPE, ) .set_null(::NULLABLE), ::cot::db::migrations::Field::new( ::cot::db::Identifier::new("phone"), as ::cot::db::DatabaseField>::TYPE, ) .set_null( as ::cot::db::DatabaseField>::NULLABLE), ::cot::db::migrations::Field::new( ::cot::db::Identifier::new("email"), as ::cot::db::DatabaseField>::TYPE, ) .set_null( as ::cot::db::DatabaseField>::NULLABLE), ::cot::db::migrations::Field::new( ::cot::db::Identifier::new("address"), as ::cot::db::DatabaseField>::TYPE, ) .set_null( as ::cot::db::DatabaseField>::NULLABLE), ::cot::db::migrations::Field::new( ::cot::db::Identifier::new("notes"), as ::cot::db::DatabaseField>::TYPE, ) .set_null( as ::cot::db::DatabaseField>::NULLABLE), ::cot::db::migrations::Field::new( ::cot::db::Identifier::new("media_token"), ::TYPE, ) .set_null(::NULLABLE) .unique(), ::cot::db::migrations::Field::new( ::cot::db::Identifier::new("color"), as ::cot::db::DatabaseField>::TYPE, ) .set_null( as ::cot::db::DatabaseField>::NULLABLE), ::cot::db::migrations::Field::new( ::cot::db::Identifier::new("status"), ::TYPE, ) .set_null(::NULLABLE), ::cot::db::migrations::Field::new( ::cot::db::Identifier::new("created_at"), ::TYPE, ) .set_null(::NULLABLE), ::cot::db::migrations::Field::new( ::cot::db::Identifier::new("updated_at"), ::TYPE, ) .set_null(::NULLABLE), ]) .build(), ::cot::db::migrations::Operation::create_model() .table_name(::cot::db::Identifier::new("web_petting__testimonial")) .fields(&[ ::cot::db::migrations::Field::new( ::cot::db::Identifier::new("id"), as ::cot::db::DatabaseField>::TYPE, ) .auto() .primary_key() .set_null( as ::cot::db::DatabaseField>::NULLABLE), ::cot::db::migrations::Field::new( ::cot::db::Identifier::new("text"), ::TYPE, ) .set_null(::NULLABLE), ::cot::db::migrations::Field::new( ::cot::db::Identifier::new("author_note"), as ::cot::db::DatabaseField>::TYPE, ) .set_null( as ::cot::db::DatabaseField>::NULLABLE), ::cot::db::migrations::Field::new( ::cot::db::Identifier::new("image_path"), as ::cot::db::DatabaseField>::TYPE, ) .set_null( as ::cot::db::DatabaseField>::NULLABLE), ::cot::db::migrations::Field::new( ::cot::db::Identifier::new("status"), ::TYPE, ) .set_null(::NULLABLE), ::cot::db::migrations::Field::new( ::cot::db::Identifier::new("sort_order"), ::TYPE, ) .set_null(::NULLABLE), ::cot::db::migrations::Field::new( ::cot::db::Identifier::new("created_at"), ::TYPE, ) .set_null(::NULLABLE), ]) .build(), ::cot::db::migrations::Operation::create_model() .table_name(::cot::db::Identifier::new("web_petting__visit")) .fields(&[ ::cot::db::migrations::Field::new( ::cot::db::Identifier::new("id"), as ::cot::db::DatabaseField>::TYPE, ) .auto() .primary_key() .set_null( as ::cot::db::DatabaseField>::NULLABLE), ::cot::db::migrations::Field::new( ::cot::db::Identifier::new("client_id"), as ::cot::db::DatabaseField>::TYPE, ) .foreign_key( ::TABLE_NAME, ::PRIMARY_KEY_NAME, ::cot::db::ForeignKeyOnDeletePolicy::Restrict, ::cot::db::ForeignKeyOnUpdatePolicy::Restrict, ) .set_null( as ::cot::db::DatabaseField>::NULLABLE, ), ::cot::db::migrations::Field::new( ::cot::db::Identifier::new("user_id"), as ::cot::db::DatabaseField>::TYPE, ) .foreign_key( ::TABLE_NAME, ::PRIMARY_KEY_NAME, ::cot::db::ForeignKeyOnDeletePolicy::Restrict, ::cot::db::ForeignKeyOnUpdatePolicy::Restrict, ) .set_null( as ::cot::db::DatabaseField>::NULLABLE, ), ::cot::db::migrations::Field::new( ::cot::db::Identifier::new("visit_date"), ::TYPE, ) .set_null(::NULLABLE), ::cot::db::migrations::Field::new( ::cot::db::Identifier::new("time_start"), ::TYPE, ) .set_null(::NULLABLE), ::cot::db::migrations::Field::new( ::cot::db::Identifier::new("time_end"), ::TYPE, ) .set_null(::NULLABLE), ::cot::db::migrations::Field::new( ::cot::db::Identifier::new("notes"), as ::cot::db::DatabaseField>::TYPE, ) .set_null( as ::cot::db::DatabaseField>::NULLABLE), ::cot::db::migrations::Field::new( ::cot::db::Identifier::new("public_notes"), as ::cot::db::DatabaseField>::TYPE, ) .set_null( as ::cot::db::DatabaseField>::NULLABLE), ::cot::db::migrations::Field::new( ::cot::db::Identifier::new("client_feedback"), as ::cot::db::DatabaseField>::TYPE, ) .set_null( as ::cot::db::DatabaseField>::NULLABLE), ::cot::db::migrations::Field::new( ::cot::db::Identifier::new("status"), ::TYPE, ) .set_null(::NULLABLE), ::cot::db::migrations::Field::new( ::cot::db::Identifier::new("created_at"), ::TYPE, ) .set_null(::NULLABLE), ::cot::db::migrations::Field::new( ::cot::db::Identifier::new("updated_at"), ::TYPE, ) .set_null(::NULLABLE), ]) .build(), ::cot::db::migrations::Operation::create_model() .table_name(::cot::db::Identifier::new("web_petting__media")) .fields(&[ ::cot::db::migrations::Field::new( ::cot::db::Identifier::new("id"), as ::cot::db::DatabaseField>::TYPE, ) .auto() .primary_key() .set_null( as ::cot::db::DatabaseField>::NULLABLE), ::cot::db::migrations::Field::new( ::cot::db::Identifier::new("client_id"), as ::cot::db::DatabaseField>::TYPE, ) .foreign_key( ::TABLE_NAME, ::PRIMARY_KEY_NAME, ::cot::db::ForeignKeyOnDeletePolicy::Restrict, ::cot::db::ForeignKeyOnUpdatePolicy::Restrict, ) .set_null( as ::cot::db::DatabaseField>::NULLABLE, ), ::cot::db::migrations::Field::new( ::cot::db::Identifier::new("visit_id"), > as ::cot::db::DatabaseField>::TYPE, ) .foreign_key( ::TABLE_NAME, ::PRIMARY_KEY_NAME, ::cot::db::ForeignKeyOnDeletePolicy::Restrict, ::cot::db::ForeignKeyOnUpdatePolicy::Restrict, ) .set_null( > as ::cot::db::DatabaseField>::NULLABLE, ), ::cot::db::migrations::Field::new( ::cot::db::Identifier::new("file_path"), ::TYPE, ) .set_null(::NULLABLE), ::cot::db::migrations::Field::new( ::cot::db::Identifier::new("file_type"), ::TYPE, ) .set_null(::NULLABLE), ::cot::db::migrations::Field::new( ::cot::db::Identifier::new("caption"), as ::cot::db::DatabaseField>::TYPE, ) .set_null( as ::cot::db::DatabaseField>::NULLABLE), ::cot::db::migrations::Field::new( ::cot::db::Identifier::new("status"), ::TYPE, ) .set_null(::NULLABLE), ::cot::db::migrations::Field::new( ::cot::db::Identifier::new("created_at"), ::TYPE, ) .set_null(::NULLABLE), ]) .build(), ::cot::db::migrations::Operation::create_model() .table_name(::cot::db::Identifier::new("web_petting__lead")) .fields(&[ ::cot::db::migrations::Field::new( ::cot::db::Identifier::new("id"), as ::cot::db::DatabaseField>::TYPE, ) .auto() .primary_key() .set_null( as ::cot::db::DatabaseField>::NULLABLE), ::cot::db::migrations::Field::new( ::cot::db::Identifier::new("name"), ::TYPE, ) .set_null(::NULLABLE), ::cot::db::migrations::Field::new( ::cot::db::Identifier::new("phone"), as ::cot::db::DatabaseField>::TYPE, ) .set_null( as ::cot::db::DatabaseField>::NULLABLE), ::cot::db::migrations::Field::new( ::cot::db::Identifier::new("email"), as ::cot::db::DatabaseField>::TYPE, ) .set_null( as ::cot::db::DatabaseField>::NULLABLE), ::cot::db::migrations::Field::new( ::cot::db::Identifier::new("comment"), as ::cot::db::DatabaseField>::TYPE, ) .set_null( as ::cot::db::DatabaseField>::NULLABLE), ::cot::db::migrations::Field::new( ::cot::db::Identifier::new("status"), ::TYPE, ) .set_null(::NULLABLE), ::cot::db::migrations::Field::new( ::cot::db::Identifier::new("client_id"), > as ::cot::db::DatabaseField>::TYPE, ) .foreign_key( ::TABLE_NAME, ::PRIMARY_KEY_NAME, ::cot::db::ForeignKeyOnDeletePolicy::Restrict, ::cot::db::ForeignKeyOnUpdatePolicy::Restrict, ) .set_null( > as ::cot::db::DatabaseField>::NULLABLE, ), ::cot::db::migrations::Field::new( ::cot::db::Identifier::new("created_at"), ::TYPE, ) .set_null(::NULLABLE), ::cot::db::migrations::Field::new( ::cot::db::Identifier::new("updated_at"), ::TYPE, ) .set_null(::NULLABLE), ]) .build(), ]; }