-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathembed_migrations.rs
40 lines (33 loc) · 1.27 KB
/
embed_migrations.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
use diesel_migrations::{EmbeddedMigration, EmbeddedMigrations, EmbeddedName, TomlMetadataWrapper};
pub const EMBEDDED_MIGRATIONS: EmbeddedMigrations =
EmbeddedMigrations::new(&[DIESEL_MIGRATION, SERVICE_MIGRATION]);
pub const DIESEL_MIGRATION: EmbeddedMigration = EmbeddedMigration::new(
DIESEL_UP,
Some(DIESEL_DOWN),
EmbeddedName::new(DIESEL_NAME),
TomlMetadataWrapper::new(true),
);
pub const SERVICE_MIGRATION: EmbeddedMigration = EmbeddedMigration::new(
SERVICE_UP,
Some(SERVICE_DOWN),
EmbeddedName::new(SERVICE_NAME),
TomlMetadataWrapper::new(true),
);
const DIESEL_NAME: &'static str = "00000000000000_diesel_initial_setup";
const DIESEL_UP: &'static str = include_str!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/migrations/00000000000000_diesel_initial_setup/up.sql"
));
const DIESEL_DOWN: &'static str = include_str!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/migrations/00000000000000_diesel_initial_setup/down.sql"
));
const SERVICE_NAME: &'static str = "2024-08-12-093223_smdb";
const SERVICE_UP: &'static str = include_str!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/migrations/2024-08-15-070500_services/up.sql"
));
const SERVICE_DOWN: &'static str = include_str!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/migrations/2024-08-15-070500_services/down.sql"
));