Add customer_id and order_id
This commit is contained in:
parent
8871f46738
commit
b04f73cb51
@ -184,9 +184,18 @@ async fn server(opts: ServerOpts) -> Result<()> {
|
||||
}
|
||||
|
||||
async fn migrate(opts: MigrateOpts) -> Result<()> {
|
||||
use sqlx::migrate::MigrateError;
|
||||
|
||||
let db = database::Database::build(&opts.db_url()).await?;
|
||||
sqlx::migrate!("../db/migrate").run(db.pool()).await.expect("Failed to migrate");
|
||||
Ok(())
|
||||
let res: std::result::Result<(), MigrateError> =
|
||||
sqlx::migrate!("../db/migrate").run(db.pool()).await;
|
||||
match res {
|
||||
Ok(()) => return Ok(()),
|
||||
Err(e) => {
|
||||
eprintln!("{e}");
|
||||
std::process::exit(1);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
async fn generate_hash(_opts: GenerateHashOpts) -> Result<()> {
|
||||
|
@ -1,5 +1,3 @@
|
||||
BEGIN;
|
||||
|
||||
CREATE TYPE "Price" AS (
|
||||
"value" integer,
|
||||
"currency" varchar
|
||||
@ -10,5 +8,3 @@ ADD COLUMN "deliver_days_flag" int
|
||||
NOT NULL
|
||||
-- 0x1111111
|
||||
DEFAULT 127;
|
||||
|
||||
COMMIT;
|
||||
|
5
db/migrate/202204180708_add_payment_fields.sql
Normal file
5
db/migrate/202204180708_add_payment_fields.sql
Normal file
@ -0,0 +1,5 @@
|
||||
ALTER TABLE accounts
|
||||
ADD COLUMN customer_id uuid not null default gen_random_uuid();
|
||||
|
||||
ALTER TABLE account_orders
|
||||
ADD COLUMN order_id varchar unique;
|
Loading…
Reference in New Issue
Block a user