From 37241b2357d8591853cad423f6893f2b731030df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Wo=C5=BAniak?= Date: Tue, 6 Jun 2023 17:02:42 +0200 Subject: [PATCH] Nice db split --- Cargo.lock | 1 + migration/Cargo.toml | 1 + migration/src/carts/m20230603_102634_types.rs | 22 + migration/src/carts/m20230603_120814_carts.rs | 104 + migration/src/carts/mod.rs | 16 + .../m20230603_120814_batch_jobs.rs} | 13 +- migration/src/jobs/mod.rs | 13 + migration/src/lib.rs | 29 +- migration/src/main.rs | 76 +- .../{ => public}/m20230603_102630_schema.rs | 0 .../{ => public}/m20230603_102634_types.rs | 27 +- .../m20230603_120814_addresses.rs | 0 migration/src/public/mod.rs | 19 + migration/src/schema_list.rs | 2 + migration/src/types.rs | 28 + migrations/20230603073510_init.sql | 3470 +---------------- 16 files changed, 426 insertions(+), 3395 deletions(-) create mode 100644 migration/src/carts/m20230603_102634_types.rs create mode 100644 migration/src/carts/m20230603_120814_carts.rs create mode 100644 migration/src/carts/mod.rs rename migration/src/{m20230603_120814_jobs.rs => jobs/m20230603_120814_batch_jobs.rs} (90%) create mode 100644 migration/src/jobs/mod.rs rename migration/src/{ => public}/m20230603_102630_schema.rs (100%) rename migration/src/{ => public}/m20230603_102634_types.rs (83%) rename migration/src/{ => public}/m20230603_120814_addresses.rs (100%) create mode 100644 migration/src/public/mod.rs diff --git a/Cargo.lock b/Cargo.lock index 14a7e20..bc29385 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3279,6 +3279,7 @@ name = "migration" version = "0.1.0" dependencies = [ "async-std", + "async-trait", "clap 3.2.25", "dotenv", "sea-orm-migration", diff --git a/migration/Cargo.toml b/migration/Cargo.toml index c878d10..ff18ef1 100644 --- a/migration/Cargo.toml +++ b/migration/Cargo.toml @@ -14,6 +14,7 @@ clap = { version = "3.2.25", features = ['derive'] } tracing = { version = "0.1.37" } tracing-subscriber = { version = "0.3.17", features = ['env-filter'] } dotenv = { version = "0.15.0" } +async-trait = { version = "0.1.68" } [dependencies.sea-orm-migration] version = "0.11.0" diff --git a/migration/src/carts/m20230603_102634_types.rs b/migration/src/carts/m20230603_102634_types.rs new file mode 100644 index 0000000..e0d092d --- /dev/null +++ b/migration/src/carts/m20230603_102634_types.rs @@ -0,0 +1,22 @@ +use sea_orm::Iterable; +use sea_orm_migration::prelude::*; + +use crate::extension::postgres::Type; +use crate::types::*; +use crate::{create_type, drop_type}; + +#[derive(DeriveMigrationName)] +pub struct Migration; + +#[async_trait::async_trait] +impl MigrationTrait for Migration { + async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> { + create_type!(manager, CartType); + Ok(()) + } + + async fn down(&self, manager: &SchemaManager) -> Result<(), DbErr> { + drop_type!(manager, CartType); + Ok(()) + } +} diff --git a/migration/src/carts/m20230603_120814_carts.rs b/migration/src/carts/m20230603_120814_carts.rs new file mode 100644 index 0000000..e7ebb24 --- /dev/null +++ b/migration/src/carts/m20230603_120814_carts.rs @@ -0,0 +1,104 @@ +use sea_orm_migration::prelude::*; +use sea_query::expr::SimpleExpr; + +/// ```sql +/// id character varying NOT NULL, +/// email character varying, +/// billing_address_id character varying, +/// shipping_address_id character varying, +/// region_id character varying NOT NULL, +/// customer_id character varying, +/// payment_id character varying, +/// type public.cart_types DEFAULT 'default'::public.cart_types NOT NULL, +/// completed_at timestamp with time zone, +/// created_at timestamp with time zone DEFAULT now() NOT NULL, +/// updated_at timestamp with time zone DEFAULT now() NOT NULL, +/// deleted_at timestamp with time zone, +/// metadata jsonb, +/// idempotency_key character varying, +/// context jsonb, +/// payment_authorized_at timestamp with time zone, +/// sales_channel_id character varying +/// ``` +#[derive(DeriveMigrationName)] +pub struct Migration; + +#[async_trait::async_trait] +impl MigrationTrait for Migration { + async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> { + manager + .create_table( + Table::create() + .table(Cart::Carts) + .col( + ColumnDef::new(Cart::Id) + .uuid() + .not_null() + .default(SimpleExpr::Custom("public.uuid_generate_v4()".into())) + .primary_key(), + ) + .col(ColumnDef::new(Cart::Email).string()) + .col(ColumnDef::new(Cart::BillingAddressId).uuid()) + .col(ColumnDef::new(Cart::ShippingAddressId).uuid()) + .col(ColumnDef::new(Cart::RegionId).uuid().not_null()) + .col(ColumnDef::new(Cart::CustomerId).uuid()) + .col(ColumnDef::new(Cart::PaymentId).uuid()) + .col( + ColumnDef::new(Cart::CartType) + .string() + .default(SimpleExpr::Custom("'default'::public.cart_types".into())) + .not_null(), + ) + .col(ColumnDef::new(Cart::CompletedAt).timestamp()) + .col( + ColumnDef::new(Cart::CreatedAt) + .timestamp() + .default(SimpleExpr::Custom("now()".into())) + .not_null(), + ) + .col( + ColumnDef::new(Cart::UpdatedAt) + .timestamp() + .default(SimpleExpr::Custom("now()".into())) + .not_null(), + ) + .col(ColumnDef::new(Cart::DeletedAt).timestamp()) + .col(ColumnDef::new(Cart::Metadata).json_binary()) + .col(ColumnDef::new(Cart::IdempotencyKey).uuid()) + .col(ColumnDef::new(Cart::Context).json_binary()) + .col(ColumnDef::new(Cart::PaymentAuthorizedAt).timestamp()) + .col(ColumnDef::new(Cart::SalesChannelId).uuid()) + .to_owned(), + ) + .await + } + + async fn down(&self, manager: &SchemaManager) -> Result<(), DbErr> { + manager + .drop_table(Table::drop().table(Cart::Carts).to_owned()) + .await?; + Ok(()) + } +} + +#[derive(Iden)] +enum Cart { + Carts, + Id, + Email, + BillingAddressId, + ShippingAddressId, + RegionId, + CustomerId, + PaymentId, + CartType, + CompletedAt, + CreatedAt, + UpdatedAt, + DeletedAt, + Metadata, + IdempotencyKey, + Context, + PaymentAuthorizedAt, + SalesChannelId, +} diff --git a/migration/src/carts/mod.rs b/migration/src/carts/mod.rs new file mode 100644 index 0000000..b7b6e89 --- /dev/null +++ b/migration/src/carts/mod.rs @@ -0,0 +1,16 @@ +use sea_orm_migration::{MigrationTrait, MigratorTrait}; + +mod m20230603_102634_types; +mod m20230603_120814_carts; + +pub struct CartsMigrator; + +#[async_trait::async_trait] +impl MigratorTrait for CartsMigrator { + fn migrations() -> Vec> { + vec![ + Box::new(m20230603_102634_types::Migration), + Box::new(m20230603_120814_carts::Migration), + ] + } +} diff --git a/migration/src/m20230603_120814_jobs.rs b/migration/src/jobs/m20230603_120814_batch_jobs.rs similarity index 90% rename from migration/src/m20230603_120814_jobs.rs rename to migration/src/jobs/m20230603_120814_batch_jobs.rs index 24180ef..de5bb99 100644 --- a/migration/src/m20230603_120814_jobs.rs +++ b/migration/src/jobs/m20230603_120814_batch_jobs.rs @@ -1,23 +1,12 @@ use sea_orm_migration::prelude::*; -use sea_orm_migration::sea_orm::Statement; use sea_query::expr::SimpleExpr; -use crate::sea_orm::DatabaseBackend; - #[derive(DeriveMigrationName)] pub struct Migration; #[async_trait::async_trait] impl MigrationTrait for Migration { async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> { - manager - .get_connection() - .execute(Statement::from_string( - DatabaseBackend::Postgres, - "CREATE EXTENSION \"uuid-ossp\"".to_string(), - )) - .await?; - manager .create_table( Table::create() @@ -41,7 +30,7 @@ impl MigrationTrait for Migration { ColumnDef::new(BatchJob::Id) .uuid() .not_null() - .default(SimpleExpr::Custom("uuid_generate_v4()".into())) + .default(SimpleExpr::Custom("public.uuid_generate_v4()".into())) .primary_key(), ) .col(ColumnDef::new(BatchJob::BatchType).string().not_null()) diff --git a/migration/src/jobs/mod.rs b/migration/src/jobs/mod.rs new file mode 100644 index 0000000..e9c58ad --- /dev/null +++ b/migration/src/jobs/mod.rs @@ -0,0 +1,13 @@ +use sea_orm_migration::{MigrationTrait, MigratorTrait}; + +pub mod m20230603_120814_batch_jobs; + +pub struct JobsMigrator; + +#[async_trait::async_trait] +impl MigratorTrait for JobsMigrator { + fn migrations() -> Vec> { + eprintln!("JobsMigrator"); + vec![Box::new(m20230603_120814_batch_jobs::Migration)] + } +} diff --git a/migration/src/lib.rs b/migration/src/lib.rs index 58a0b31..45cb14b 100644 --- a/migration/src/lib.rs +++ b/migration/src/lib.rs @@ -1,30 +1,7 @@ pub use sea_orm_migration::prelude::*; -mod m20230603_102630_schema; -mod m20230603_102634_types; -mod m20230603_120814_addresses; -mod m20230603_120814_jobs; +pub mod carts; +pub mod jobs; +pub mod public; pub mod schema_list; pub mod types; - -pub struct PublicMigrator; - -#[async_trait::async_trait] -impl MigratorTrait for PublicMigrator { - fn migrations() -> Vec> { - vec![ - Box::new(m20230603_102630_schema::Migration), - Box::new(m20230603_102634_types::Migration), - Box::new(m20230603_120814_addresses::Migration), - ] - } -} - -pub struct JobsMigrator; - -#[async_trait::async_trait] -impl MigratorTrait for JobsMigrator { - fn migrations() -> Vec> { - vec![Box::new(m20230603_120814_jobs::Migration)] - } -} diff --git a/migration/src/main.rs b/migration/src/main.rs index fd5238f..f98653f 100644 --- a/migration/src/main.rs +++ b/migration/src/main.rs @@ -20,14 +20,27 @@ async fn main() { init_logger(cli.verbose); - cli.database_schema = Some(PostgreSQLSchema::Public.as_str().into()); - run_cli(&cli, migration::PublicMigrator).await; - - cli.database_schema = Some(PostgreSQLSchema::Jobs.as_str().into()); - run_cli(&cli, migration::JobsMigrator).await; + run_cli( + &mut cli, + PostgreSQLSchema::Public, + migration::public::PublicMigrator, + ) + .await; + run_cli( + &mut cli, + PostgreSQLSchema::Jobs, + migration::jobs::JobsMigrator, + ) + .await; + run_cli( + &mut cli, + PostgreSQLSchema::Carts, + migration::carts::CartsMigrator, + ) + .await; } -pub async fn run_cli(cli: &Cli, migrator: M) +pub async fn run_cli(cli: &mut Cli, schema: PostgreSQLSchema, migrator: M) where M: MigratorTrait, { @@ -35,22 +48,25 @@ where .database_url .as_ref() .expect("Environment variable 'DATABASE_URL' not set"); - let schema = cli - .database_schema - .as_ref() - .cloned() - .unwrap_or_else(|| "public".to_owned()); + let schema = schema.as_str().to_string(); let connect_options = ConnectOptions::new(url.clone()) - .set_schema_search_path(schema) + .set_schema_search_path(schema.clone()) .to_owned(); - let db = &Database::connect(connect_options) + let db = Database::connect(connect_options) .await .expect("Fail to acquire database connection"); - run_migrate(migrator, db, cli.command.clone()) + db.execute_unprepared(&format!("SET search_path = '{}'", schema)) .await - .unwrap_or_else(handle_error); + .unwrap(); + + let res = run_migrate(migrator, &db, cli.command.clone()).await; + if cfg!(debug_assertions) { + res.unwrap(); + } else { + res.unwrap_or_else(handle_error); + } } pub async fn run_migrate( @@ -83,7 +99,7 @@ where fn init_logger(verbose: bool) { let filter = match verbose { true => "debug", - false => "sea_orm_migration=info", + false => "sea_orm_migration=trace", }; let filter_layer = EnvFilter::try_new(filter).unwrap(); @@ -96,8 +112,8 @@ fn init_logger(verbose: bool) { .init() } else { let fmt_layer = tracing_subscriber::fmt::layer() - .with_target(false) - .with_level(false) + .with_target(true) + .with_level(true) .without_time(); tracing_subscriber::registry() .with(filter_layer) @@ -120,18 +136,6 @@ pub struct Cli { #[clap(action, short = 'v', long, global = true, help = "Show debug messages")] verbose: bool, - #[clap( - value_parser, - global = true, - short = 's', - long, - env = "DATABASE_SCHEMA", - long_help = "Database schema\n \ - - For MySQL and SQLite, this argument is ignored.\n \ - - For PostgreSQL, this argument is optional with default value 'public'.\n" - )] - database_schema: Option, - #[clap( value_parser, global = true, @@ -173,18 +177,6 @@ you should provide the directory of that submodule.", )] migration_dir: String, - #[clap( - value_parser, - global = true, - short = 's', - long, - env = "DATABASE_SCHEMA", - long_help = "Database schema\n \ - - For MySQL and SQLite, this argument is ignored.\n \ - - For PostgreSQL, this argument is optional with default value 'public'.\n" - )] - database_schema: Option, - #[clap( value_parser, global = true, diff --git a/migration/src/m20230603_102630_schema.rs b/migration/src/public/m20230603_102630_schema.rs similarity index 100% rename from migration/src/m20230603_102630_schema.rs rename to migration/src/public/m20230603_102630_schema.rs diff --git a/migration/src/m20230603_102634_types.rs b/migration/src/public/m20230603_102634_types.rs similarity index 83% rename from migration/src/m20230603_102634_types.rs rename to migration/src/public/m20230603_102634_types.rs index 40f8e7b..1e1a6a3 100644 --- a/migration/src/m20230603_102634_types.rs +++ b/migration/src/public/m20230603_102634_types.rs @@ -3,32 +3,7 @@ use sea_orm_migration::prelude::*; use crate::extension::postgres::Type; use crate::types::*; - -macro_rules! create_type { - ($manager: ident, $ty: ident) => { - $manager - .create_type( - Type::create() - .as_enum($ty::iter().next().unwrap()) - .values($ty::iter().skip(1)) - .to_owned(), - ) - .await?; - }; -} -macro_rules! drop_type { - ($manager: ident, $ty: ident) => { - $manager - .drop_type( - Type::drop() - .if_exists() - .cascade() - .name($ty::iter().next().unwrap()) - .to_owned(), - ) - .await?; - }; -} +use crate::{create_type, drop_type}; #[derive(DeriveMigrationName)] pub struct Migration; diff --git a/migration/src/m20230603_120814_addresses.rs b/migration/src/public/m20230603_120814_addresses.rs similarity index 100% rename from migration/src/m20230603_120814_addresses.rs rename to migration/src/public/m20230603_120814_addresses.rs diff --git a/migration/src/public/mod.rs b/migration/src/public/mod.rs new file mode 100644 index 0000000..2589127 --- /dev/null +++ b/migration/src/public/mod.rs @@ -0,0 +1,19 @@ +use sea_orm_migration::{MigrationTrait, MigratorTrait}; + +mod m20230603_102630_schema; +mod m20230603_102634_types; +mod m20230603_120814_addresses; + +pub struct PublicMigrator; + +#[async_trait::async_trait] +impl MigratorTrait for PublicMigrator { + fn migrations() -> Vec> { + eprintln!("PublicMigrator"); + vec![ + Box::new(m20230603_102630_schema::Migration), + Box::new(m20230603_102634_types::Migration), + Box::new(m20230603_120814_addresses::Migration), + ] + } +} diff --git a/migration/src/schema_list.rs b/migration/src/schema_list.rs index c64979f..4a7506e 100644 --- a/migration/src/schema_list.rs +++ b/migration/src/schema_list.rs @@ -6,6 +6,7 @@ use sea_orm_migration::prelude::*; pub enum PostgreSQLSchema { Public, Jobs, + Carts, } impl PostgreSQLSchema { @@ -13,6 +14,7 @@ impl PostgreSQLSchema { match self { PostgreSQLSchema::Public => "public", PostgreSQLSchema::Jobs => "jobs", + PostgreSQLSchema::Carts => "carts", } } } diff --git a/migration/src/types.rs b/migration/src/types.rs index a4a2e9f..2f721f2 100644 --- a/migration/src/types.rs +++ b/migration/src/types.rs @@ -1,6 +1,34 @@ use sea_orm::EnumIter; use sea_orm_migration::prelude::*; +#[macro_export] +macro_rules! create_type { + ($manager: ident, $ty: ident) => { + $manager + .create_type( + Type::create() + .as_enum($ty::iter().next().unwrap()) + .values($ty::iter().skip(1)) + .to_owned(), + ) + .await?; + }; +} +#[macro_export] +macro_rules! drop_type { + ($manager: ident, $ty: ident) => { + $manager + .drop_type( + Type::drop() + .if_exists() + .cascade() + .name($ty::iter().next().unwrap()) + .to_owned(), + ) + .await?; + }; +} + #[derive(Iden, EnumIter)] pub enum PaymentCollectionStatus { PaymentCollectionStatuses, diff --git a/migrations/20230603073510_init.sql b/migrations/20230603073510_init.sql index 1a21fb9..9cf50d9 100644 --- a/migrations/20230603073510_init.sql +++ b/migrations/20230603073510_init.sql @@ -206,7 +206,7 @@ CREATE TYPE public.user_roles AS ENUM ( CREATE TABLE public.addresses ( - id character varying NOT NULL, + id uuid NOT NULL, customer_id character varying, company character varying, first_name character varying, @@ -226,18 +226,18 @@ CREATE TABLE public.addresses CREATE TABLE public.analytics_configs ( - id character varying NOT NULL, + id uuid NOT NULL, created_at timestamp with time zone DEFAULT now() NOT NULL, updated_at timestamp with time zone DEFAULT now() NOT NULL, deleted_at timestamp with time zone, - user_id character varying NOT NULL, + user_id uuid NOT NULL, opt_out boolean DEFAULT false NOT NULL, anonymize boolean DEFAULT false NOT NULL ); CREATE TABLE public.batch_jobs ( - id character varying NOT NULL, + id uuid NOT NULL, type text NOT NULL, created_by character varying, context jsonb, @@ -254,22 +254,13 @@ CREATE TABLE public.batch_jobs deleted_at timestamp with time zone ); ----- ########################################################### ----- ########################################################### ----- ########################################################### ----- ########################################################### ----- ########################################################### ----- ########################################################### ----- ########################################################### ----- ########################################################### - CREATE TABLE public.carts ( - id character varying NOT NULL, + id uuid NOT NULL, email character varying, billing_address_id character varying, shipping_address_id character varying, - region_id character varying NOT NULL, + region_id uuid NOT NULL, customer_id character varying, payment_id character varying, type public.cart_types DEFAULT 'default'::public.cart_types NOT NULL, @@ -284,46 +275,32 @@ CREATE TABLE public.carts sales_channel_id character varying ); - -ALTER TABLE public.carts - OWNER TO postgres; - --- --- Name: cart_discounts; Type: TABLE; Schema: public; Owner: postgres --- +---- ########################################################### +---- ########################################################### +---- ########################################################### +---- ########################################################### +---- ########################################################### +---- ########################################################### +---- ########################################################### +---- ########################################################### CREATE TABLE public.cart_discounts ( - cart_id character varying NOT NULL, - discount_id character varying NOT NULL + cart_id uuid NOT NULL, + discount_id uuid NOT NULL ); - -ALTER TABLE public.cart_discounts - OWNER TO postgres; - --- --- Name: cart_gift_cards; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.cart_gift_cards ( - cart_id character varying NOT NULL, - gift_card_id character varying NOT NULL + cart_id uuid NOT NULL, + gift_card_id uuid NOT NULL ); -ALTER TABLE public.cart_gift_cards - OWNER TO postgres; - --- --- Name: claim_image; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.claim_images ( - id character varying NOT NULL, - claim_item_id character varying NOT NULL, + id uuid NOT NULL, + claim_item_id uuid NOT NULL, url character varying NOT NULL, created_at timestamp with time zone DEFAULT now() NOT NULL, updated_at timestamp with time zone DEFAULT now() NOT NULL, @@ -331,21 +308,13 @@ CREATE TABLE public.claim_images metadata jsonb ); - -ALTER TABLE public.claim_images - OWNER TO postgres; - --- --- Name: claim_item; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.claim_items ( - id character varying NOT NULL, - claim_order_id character varying NOT NULL, - item_id character varying NOT NULL, - variant_id character varying NOT NULL, - reason public.claim_item_reasons NOT NULL, + id uuid NOT NULL, + claim_order_id uuid NOT NULL, + item_id uuid NOT NULL, + variant_id uuid NOT NULL, + reason public.claim_item_reasons NOT NULL, note character varying, quantity integer NOT NULL, created_at timestamp with time zone DEFAULT now() NOT NULL, @@ -354,35 +323,19 @@ CREATE TABLE public.claim_items metadata jsonb ); - -ALTER TABLE public.claim_items - OWNER TO postgres; - --- --- Name: claim_item_tags; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.claim_item_tags ( - item_id character varying NOT NULL, - tag_id character varying NOT NULL + item_id uuid NOT NULL, + tag_id uuid NOT NULL ); - -ALTER TABLE public.claim_item_tags - OWNER TO postgres; - --- --- Name: claim_order; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.claim_orders ( - id character varying NOT NULL, + id uuid NOT NULL, payment_status public.claim_order_payment_statuses DEFAULT 'na'::public.claim_order_payment_statuses NOT NULL, fulfillment_status public.claim_order_fulfillment_statuses DEFAULT 'not_fulfilled'::public.claim_order_fulfillment_statuses NOT NULL, type public.claim_order_types NOT NULL, - order_id character varying NOT NULL, + order_id uuid NOT NULL, shipping_address_id character varying, refund_amount integer, canceled_at timestamp with time zone, @@ -394,17 +347,9 @@ CREATE TABLE public.claim_orders no_notification boolean ); - -ALTER TABLE public.claim_orders - OWNER TO postgres; - --- --- Name: claim_tag; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.claim_tags ( - id character varying NOT NULL, + id uuid NOT NULL, value character varying NOT NULL, created_at timestamp with time zone DEFAULT now() NOT NULL, updated_at timestamp with time zone DEFAULT now() NOT NULL, @@ -412,17 +357,9 @@ CREATE TABLE public.claim_tags metadata jsonb ); - -ALTER TABLE public.claim_tags - OWNER TO postgres; - --- --- Name: country; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.countries ( - id integer NOT NULL, + id sequence NOT NULL, iso_2 character varying NOT NULL, iso_3 character varying NOT NULL, num_code integer NOT NULL, @@ -431,30 +368,6 @@ CREATE TABLE public.countries region_id character varying ); - -CREATE SEQUENCE public.country_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - -ALTER TABLE public.country_id_seq - OWNER TO postgres; - --- --- Name: country_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres --- - -ALTER SEQUENCE public.country_id_seq OWNED BY public.countries.id; - - --- --- Name: currency; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.currencies ( code character varying NOT NULL, @@ -463,19 +376,11 @@ CREATE TABLE public.currencies name character varying NOT NULL ); - -ALTER TABLE public.currencies - OWNER TO postgres; - --- --- Name: custom_shipping_option; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.custom_shipping_options ( - id character varying NOT NULL, + id uuid NOT NULL, price integer NOT NULL, - shipping_option_id character varying NOT NULL, + shipping_option_id uuid NOT NULL, cart_id character varying, created_at timestamp with time zone DEFAULT now() NOT NULL, updated_at timestamp with time zone DEFAULT now() NOT NULL, @@ -483,17 +388,9 @@ CREATE TABLE public.custom_shipping_options metadata jsonb ); - -ALTER TABLE public.custom_shipping_options - OWNER TO postgres; - --- --- Name: customer; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.customers ( - id character varying NOT NULL, + id uuid NOT NULL, email character varying NOT NULL, first_name character varying, last_name character varying, @@ -507,17 +404,9 @@ CREATE TABLE public.customers metadata jsonb ); - -ALTER TABLE public.customers - OWNER TO postgres; - --- --- Name: customer_group; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.customer_groups ( - id character varying NOT NULL, + id uuid NOT NULL, name character varying NOT NULL, created_at timestamp with time zone DEFAULT now() NOT NULL, updated_at timestamp with time zone DEFAULT now() NOT NULL, @@ -525,31 +414,15 @@ CREATE TABLE public.customer_groups metadata jsonb ); - -ALTER TABLE public.customer_groups - OWNER TO postgres; - --- --- Name: customer_group_customers; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.customer_group_customers ( - customer_group_id character varying NOT NULL, - customer_id character varying NOT NULL + customer_group_id uuid NOT NULL, + customer_id uuid NOT NULL ); - -ALTER TABLE public.customer_group_customers - OWNER TO postgres; - --- --- Name: discount; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.discounts ( - id character varying NOT NULL, + id uuid NOT NULL, code character varying NOT NULL, is_dynamic boolean NOT NULL, rule_id character varying, @@ -566,136 +439,72 @@ CREATE TABLE public.discounts valid_duration character varying ); - -ALTER TABLE public.discounts - OWNER TO postgres; - --- --- Name: discount_condition; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.discount_conditions ( - id character varying NOT NULL, - type public.discount_condition_types NOT NULL, - operator public.discount_condition_operators NOT NULL, - discount_rule_id character varying NOT NULL, - created_at timestamp with time zone DEFAULT now() NOT NULL, - updated_at timestamp with time zone DEFAULT now() NOT NULL, + id uuid NOT NULL, + type public.discount_condition_types NOT NULL, + operator public.discount_condition_operators NOT NULL, + discount_rule_id uuid NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, deleted_at timestamp with time zone, metadata jsonb ); - -ALTER TABLE public.discount_conditions - OWNER TO postgres; - --- --- Name: discount_condition_customer_group; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.discount_condition_customer_groups ( - customer_group_id character varying NOT NULL, - condition_id character varying NOT NULL, + customer_group_id uuid NOT NULL, + condition_id uuid NOT NULL, created_at timestamp with time zone DEFAULT now() NOT NULL, updated_at timestamp with time zone DEFAULT now() NOT NULL, metadata jsonb ); - -ALTER TABLE public.discount_condition_customer_groups - OWNER TO postgres; - --- --- Name: discount_condition_product; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.discount_condition_products ( - product_id character varying NOT NULL, - condition_id character varying NOT NULL, + product_id uuid NOT NULL, + condition_id uuid NOT NULL, created_at timestamp with time zone DEFAULT now() NOT NULL, updated_at timestamp with time zone DEFAULT now() NOT NULL, metadata jsonb ); - -ALTER TABLE public.discount_condition_products - OWNER TO postgres; - --- --- Name: discount_condition_product_collection; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.discount_condition_product_collections ( - product_collection_id character varying NOT NULL, - condition_id character varying NOT NULL, + product_collection_id uuid NOT NULL, + condition_id uuid NOT NULL, created_at timestamp with time zone DEFAULT now() NOT NULL, updated_at timestamp with time zone DEFAULT now() NOT NULL, metadata jsonb ); - -ALTER TABLE public.discount_condition_product_collections - OWNER TO postgres; - --- --- Name: discount_condition_product_tag; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.discount_condition_product_tags ( - product_tag_id character varying NOT NULL, - condition_id character varying NOT NULL, + product_tag_id uuid NOT NULL, + condition_id uuid NOT NULL, created_at timestamp with time zone DEFAULT now() NOT NULL, updated_at timestamp with time zone DEFAULT now() NOT NULL, metadata jsonb ); - -ALTER TABLE public.discount_condition_product_tags - OWNER TO postgres; - --- --- Name: discount_condition_product_type; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.discount_condition_product_types ( - product_type_id character varying NOT NULL, - condition_id character varying NOT NULL, + product_type_id uuid NOT NULL, + condition_id uuid NOT NULL, created_at timestamp with time zone DEFAULT now() NOT NULL, updated_at timestamp with time zone DEFAULT now() NOT NULL, metadata jsonb ); - -ALTER TABLE public.discount_condition_product_types - OWNER TO postgres; - --- --- Name: discount_regions; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.discount_regions ( - discount_id character varying NOT NULL, - region_id character varying NOT NULL + discount_id uuid NOT NULL, + region_id uuid NOT NULL ); - -ALTER TABLE public.discount_regions - OWNER TO postgres; - --- --- Name: discount_rule; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.discount_rules ( - id character varying NOT NULL, + id uuid NOT NULL, description character varying, type public.discount_rule_types NOT NULL, value integer NOT NULL, @@ -706,30 +515,17 @@ CREATE TABLE public.discount_rules metadata jsonb ); - --- --- Name: discount_rule_products; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.discount_rule_products ( - discount_rule_id character varying NOT NULL, - product_id character varying NOT NULL + discount_rule_id uuid NOT NULL, + product_id uuid NOT NULL ); - -ALTER TABLE public.discount_rule_products - OWNER TO postgres; - --- --- Name: draft_order; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.draft_orders ( - id character varying NOT NULL, + id uuid NOT NULL, status public.draft_order_statuses DEFAULT 'open'::public.draft_order_statuses NOT NULL, - display_id integer NOT NULL, + display_id sequence NOT NULL, cart_id character varying, order_id character varying, canceled_at timestamp with time zone, @@ -741,37 +537,9 @@ CREATE TABLE public.draft_orders no_notification_order boolean ); - -ALTER TABLE public.draft_orders - OWNER TO postgres; - --- --- Name: draft_order_display_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres --- - -CREATE SEQUENCE public.draft_order_display_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: draft_order_display_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres --- - -ALTER SEQUENCE public.draft_order_display_id_seq OWNED BY public.draft_orders.display_id; - - --- --- Name: fulfillment; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.fulfillments ( - id character varying NOT NULL, + id uuid NOT NULL, swap_id character varying, order_id character varying, tracking_numbers jsonb DEFAULT '[]'::jsonb NOT NULL, @@ -788,50 +556,26 @@ CREATE TABLE public.fulfillments location_id character varying ); - -ALTER TABLE public.fulfillments - OWNER TO postgres; - --- --- Name: fulfillment_item; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.fulfillment_items ( - fulfillment_id character varying NOT NULL, - item_id character varying NOT NULL, + fulfillment_id uuid NOT NULL, + item_id uuid NOT NULL, quantity integer NOT NULL ); - -ALTER TABLE public.fulfillment_items - OWNER TO postgres; - --- --- Name: fulfillment_provider; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.fulfillment_providers ( - id character varying NOT NULL, + id uuid NOT NULL, is_installed boolean DEFAULT true NOT NULL ); - -ALTER TABLE public.fulfillment_providers - OWNER TO postgres; - --- --- Name: gift_card; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.gift_cards ( - id character varying NOT NULL, + id uuid NOT NULL, code character varying NOT NULL, value integer NOT NULL, balance integer NOT NULL, - region_id character varying NOT NULL, + region_id uuid NOT NULL, order_id character varying, is_disabled boolean DEFAULT false NOT NULL, ends_at timestamp with time zone, @@ -842,36 +586,20 @@ CREATE TABLE public.gift_cards tax_rate real ); - -ALTER TABLE public.gift_cards - OWNER TO postgres; - --- --- Name: gift_card_transaction; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.gift_card_transactions ( - id character varying NOT NULL, - gift_card_id character varying NOT NULL, - order_id character varying NOT NULL, + id uuid NOT NULL, + gift_card_id uuid NOT NULL, + order_id uuid NOT NULL, amount integer NOT NULL, created_at timestamp with time zone DEFAULT now() NOT NULL, is_taxable boolean, tax_rate real ); - -ALTER TABLE public.gift_card_transactions - OWNER TO postgres; - --- --- Name: idempotency_key; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.idempotency_keys ( - id character varying NOT NULL, + id uuid NOT NULL, idempotency_key character varying NOT NULL, created_at timestamp with time zone DEFAULT now() NOT NULL, locked_at timestamp with time zone, @@ -883,17 +611,9 @@ CREATE TABLE public.idempotency_keys recovery_point character varying DEFAULT 'started'::character varying NOT NULL ); - -ALTER TABLE public.idempotency_keys - OWNER TO postgres; - --- --- Name: image; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.images ( - id character varying NOT NULL, + id uuid NOT NULL, url character varying NOT NULL, created_at timestamp with time zone DEFAULT now() NOT NULL, updated_at timestamp with time zone DEFAULT now() NOT NULL, @@ -901,17 +621,9 @@ CREATE TABLE public.images metadata jsonb ); - -ALTER TABLE public.images - OWNER TO postgres; - --- --- Name: invite; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.invites ( - id character varying NOT NULL, + id uuid NOT NULL, user_email character varying NOT NULL, role public.invite_roles DEFAULT 'member'::public.invite_roles, accepted boolean DEFAULT false NOT NULL, @@ -923,17 +635,9 @@ CREATE TABLE public.invites expires_at timestamp with time zone DEFAULT now() NOT NULL ); - -ALTER TABLE public.invites - OWNER TO postgres; - --- --- Name: line_item; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.line_items ( - id character varying NOT NULL, + id uuid NOT NULL, cart_id character varying, order_id character varying, swap_id character varying, @@ -963,93 +667,38 @@ CREATE TABLE public.line_items CONSTRAINT "CHK_c61716c68f5ad5de2834c827d3" CHECK ((fulfilled_quantity <= quantity)) ); - -ALTER TABLE public.line_items - OWNER TO postgres; - --- --- Name: line_item_adjustment; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.line_item_adjustments ( - id character varying NOT NULL, - item_id character varying NOT NULL, + id uuid NOT NULL, + item_id uuid NOT NULL, description character varying NOT NULL, discount_id character varying, amount numeric NOT NULL, metadata jsonb ); - -ALTER TABLE public.line_item_adjustments - OWNER TO postgres; - --- --- Name: line_item_tax_line; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.line_item_tax_lines ( - id character varying NOT NULL, + id uuid NOT NULL, rate real NOT NULL, name character varying NOT NULL, code character varying, created_at timestamp with time zone DEFAULT now() NOT NULL, updated_at timestamp with time zone DEFAULT now() NOT NULL, metadata jsonb, - item_id character varying NOT NULL + item_id uuid NOT NULL ); - -ALTER TABLE public.line_item_tax_lines - OWNER TO postgres; - --- --- Name: migrations; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.migrations ( - id integer NOT NULL, + id sequence NOT NULL, "timestamp" bigint NOT NULL, name character varying NOT NULL ); - -ALTER TABLE public.migrations - OWNER TO postgres; - --- --- Name: migrations_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres --- - -CREATE SEQUENCE public.migrations_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - -ALTER TABLE public.migrations_id_seq - OWNER TO postgres; - --- --- Name: migrations_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres --- - -ALTER SEQUENCE public.migrations_id_seq OWNED BY public.migrations.id; - - --- --- Name: money_amount; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.money_amounts ( - id character varying NOT NULL, + id uuid NOT NULL, currency_code character varying NOT NULL, amount integer NOT NULL, variant_id character varying, @@ -1062,20 +711,12 @@ CREATE TABLE public.money_amounts price_list_id character varying ); - -ALTER TABLE public.money_amounts - OWNER TO postgres; - --- --- Name: note; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.notes ( - id character varying NOT NULL, + id uuid NOT NULL, value character varying NOT NULL, resource_type character varying NOT NULL, - resource_id character varying NOT NULL, + resource_id uuid NOT NULL, author_id character varying, created_at timestamp with time zone DEFAULT now() NOT NULL, updated_at timestamp with time zone DEFAULT now() NOT NULL, @@ -1083,20 +724,12 @@ CREATE TABLE public.notes metadata jsonb ); - -ALTER TABLE public.notes - OWNER TO postgres; - --- --- Name: notification; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.notifications ( - id character varying NOT NULL, + id uuid NOT NULL, event_name character varying, resource_type character varying NOT NULL, - resource_id character varying NOT NULL, + resource_id uuid NOT NULL, customer_id character varying, "to" character varying NOT NULL, data jsonb NOT NULL, @@ -1106,31 +739,15 @@ CREATE TABLE public.notifications updated_at timestamp with time zone DEFAULT now() NOT NULL ); - -ALTER TABLE public.notifications - OWNER TO postgres; - --- --- Name: notification_provider; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.notification_providers ( - id character varying NOT NULL, + id uuid NOT NULL, is_installed boolean DEFAULT true NOT NULL ); - -ALTER TABLE public.notification_providers - OWNER TO postgres; - --- --- Name: oauth; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.oauth ( - id character varying NOT NULL, + id uuid NOT NULL, display_name character varying NOT NULL, application_name character varying NOT NULL, install_url character varying, @@ -1138,27 +755,19 @@ CREATE TABLE public.oauth data jsonb ); - -ALTER TABLE public.oauth - OWNER TO postgres; - --- --- Name: order; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.orders ( - id character varying NOT NULL, + id uuid NOT NULL, status public.order_statuses DEFAULT 'pending'::public.order_statuses NOT NULL, fulfillment_status public.order_fulfillment_statuses DEFAULT 'not_fulfilled'::public.order_fulfillment_statuses NOT NULL, payment_status public.order_payment_statuses DEFAULT 'not_paid'::public.order_payment_statuses NOT NULL, display_id integer NOT NULL, cart_id character varying, - customer_id character varying NOT NULL, + customer_id uuid NOT NULL, email character varying NOT NULL, billing_address_id character varying, shipping_address_id character varying, - region_id character varying NOT NULL, + region_id uuid NOT NULL, currency_code character varying NOT NULL, tax_rate real, canceled_at timestamp with time zone, @@ -1172,57 +781,18 @@ CREATE TABLE public.orders sales_channel_id character varying ); - -ALTER TABLE public.orders - OWNER TO postgres; - --- --- Name: order_discounts; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.order_discounts ( - order_id character varying NOT NULL, - discount_id character varying NOT NULL + order_id uuid NOT NULL, + discount_id uuid NOT NULL ); - -ALTER TABLE public.order_discounts - OWNER TO postgres; - --- --- Name: order_display_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres --- - -CREATE SEQUENCE public.order_display_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - -ALTER TABLE public.order_display_id_seq - OWNER TO postgres; - --- --- Name: order_display_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres --- - -ALTER SEQUENCE public.order_display_id_seq OWNED BY public.orders.display_id; - - --- --- Name: order_edit; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.order_edits ( - id character varying NOT NULL, + id uuid NOT NULL, created_at timestamp with time zone DEFAULT now() NOT NULL, updated_at timestamp with time zone DEFAULT now() NOT NULL, - order_id character varying NOT NULL, + order_id uuid NOT NULL, internal_note character varying, created_by character varying NOT NULL, requested_by character varying, @@ -1237,58 +807,34 @@ CREATE TABLE public.order_edits payment_collection_id character varying ); - -ALTER TABLE public.order_edits - OWNER TO postgres; - --- --- Name: order_gift_cards; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.order_gift_cards ( - order_id character varying NOT NULL, - gift_card_id character varying NOT NULL + order_id uuid NOT NULL, + gift_card_id uuid NOT NULL ); - -ALTER TABLE public.order_gift_cards - OWNER TO postgres; - --- --- Name: order_item_change; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.order_item_changes ( - id character varying NOT NULL, + id uuid NOT NULL, created_at timestamp with time zone DEFAULT now() NOT NULL, updated_at timestamp with time zone DEFAULT now() NOT NULL, deleted_at timestamp with time zone, type public.order_item_change_types NOT NULL, - order_edit_id character varying NOT NULL, + order_edit_id uuid NOT NULL, original_line_item_id character varying, line_item_id character varying ); - -ALTER TABLE public.order_item_changes - OWNER TO postgres; - --- --- Name: payment; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.payments ( - id character varying NOT NULL, + id uuid NOT NULL, swap_id character varying, cart_id character varying, order_id character varying, amount integer NOT NULL, currency_code character varying NOT NULL, amount_refunded integer DEFAULT 0 NOT NULL, - provider_id character varying NOT NULL, + provider_id uuid NOT NULL, data jsonb NOT NULL, captured_at timestamp with time zone, canceled_at timestamp with time zone, @@ -1298,86 +844,46 @@ CREATE TABLE public.payments idempotency_key character varying ); - -ALTER TABLE public.payments - OWNER TO postgres; - --- --- Name: payment_collection; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.payment_collections ( - id character varying NOT NULL, + id uuid NOT NULL, created_at timestamp with time zone DEFAULT now() NOT NULL, updated_at timestamp with time zone DEFAULT now() NOT NULL, deleted_at timestamp with time zone, - type public.payment_collection_types NOT NULL, - status public.payment_collection_statuses NOT NULL, + type public.payment_collection_types NOT NULL, + status public.payment_collection_statuses NOT NULL, description text, amount integer NOT NULL, authorized_amount integer, - region_id character varying NOT NULL, + region_id uuid NOT NULL, currency_code character varying NOT NULL, metadata jsonb, created_by character varying NOT NULL ); - -ALTER TABLE public.payment_collections - OWNER TO postgres; - --- --- Name: payment_collection_payments; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.payment_collection_payments ( - payment_collection_id character varying NOT NULL, - payment_id character varying NOT NULL + payment_collection_id uuid NOT NULL, + payment_id uuid NOT NULL ); - -ALTER TABLE public.payment_collection_payments - OWNER TO postgres; - --- --- Name: payment_collection_sessions; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.payment_collection_sessions ( - payment_collection_id character varying NOT NULL, - payment_session_id character varying NOT NULL + payment_collection_id uuid NOT NULL, + payment_session_id uuid NOT NULL ); - -ALTER TABLE public.payment_collection_sessions - OWNER TO postgres; - --- --- Name: payment_provider; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.payment_providers ( - id character varying NOT NULL, + id uuid NOT NULL, is_installed boolean DEFAULT true NOT NULL ); - -ALTER TABLE public.payment_providers - OWNER TO postgres; - --- --- Name: payment_session; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.payment_sessions ( - id character varying NOT NULL, + id uuid NOT NULL, cart_id character varying, - provider_id character varying NOT NULL, + provider_id uuid NOT NULL, is_selected boolean, status public.payment_session_statuses NOT NULL, data jsonb NOT NULL, @@ -1389,17 +895,9 @@ CREATE TABLE public.payment_sessions is_initiated boolean DEFAULT false NOT NULL ); - -ALTER TABLE public.payment_sessions - OWNER TO postgres; - --- --- Name: price_list; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.price_lists ( - id character varying NOT NULL, + id uuid NOT NULL, name character varying NOT NULL, description character varying NOT NULL, type public.price_list_types DEFAULT 'sale'::public.price_list_types NOT NULL, @@ -1411,38 +909,22 @@ CREATE TABLE public.price_lists deleted_at timestamp with time zone ); - -ALTER TABLE public.price_lists - OWNER TO postgres; - --- --- Name: price_list_customer_groups; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.price_list_customer_groups ( - price_list_id character varying NOT NULL, - customer_group_id character varying NOT NULL + price_list_id uuid NOT NULL, + customer_group_id uuid NOT NULL ); - -ALTER TABLE public.price_list_customer_groups - OWNER TO postgres; - --- --- Name: product; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.products ( - id character varying NOT NULL, + id uuid NOT NULL, title character varying NOT NULL, subtitle character varying, description character varying, handle character varying, is_giftcard boolean DEFAULT false NOT NULL, thumbnail character varying, - profile_id character varying NOT NULL, + profile_id uuid NOT NULL, weight integer, length integer, height integer, @@ -1462,17 +944,9 @@ CREATE TABLE public.products external_id character varying ); - -ALTER TABLE public.products - OWNER TO postgres; - --- --- Name: product_category; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.product_categories ( - id character varying NOT NULL, + id uuid NOT NULL, name text NOT NULL, handle text NOT NULL, parent_category_id character varying, @@ -1486,31 +960,15 @@ CREATE TABLE public.product_categories CONSTRAINT product_category_rank_check CHECK ((rank >= 0)) ); - -ALTER TABLE public.product_categories - OWNER TO postgres; - --- --- Name: product_category_product; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.product_category_products ( - product_category_id character varying NOT NULL, - product_id character varying NOT NULL + product_category_id uuid NOT NULL, + product_id uuid NOT NULL ); - -ALTER TABLE public.product_category_products - OWNER TO postgres; - --- --- Name: product_collection; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.product_collections ( - id character varying NOT NULL, + id uuid NOT NULL, title character varying NOT NULL, handle character varying, created_at timestamp with time zone DEFAULT now() NOT NULL, @@ -1519,31 +977,15 @@ CREATE TABLE public.product_collections metadata jsonb ); - -ALTER TABLE public.product_collections - OWNER TO postgres; - --- --- Name: product_images; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.product_images ( - product_id character varying NOT NULL, - image_id character varying NOT NULL + product_id uuid NOT NULL, + image_id uuid NOT NULL ); - -ALTER TABLE public.product_images - OWNER TO postgres; - --- --- Name: product_option; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.product_options ( - id character varying NOT NULL, + id uuid NOT NULL, title character varying NOT NULL, created_at timestamp with time zone DEFAULT now() NOT NULL, updated_at timestamp with time zone DEFAULT now() NOT NULL, @@ -1552,51 +994,27 @@ CREATE TABLE public.product_options product_id character varying ); - -ALTER TABLE public.product_options - OWNER TO postgres; - --- --- Name: product_option_value; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.product_option_values ( - id character varying NOT NULL, + id uuid NOT NULL, value character varying NOT NULL, - option_id character varying NOT NULL, - variant_id character varying NOT NULL, + option_id uuid NOT NULL, + variant_id uuid NOT NULL, created_at timestamp with time zone DEFAULT now() NOT NULL, updated_at timestamp with time zone DEFAULT now() NOT NULL, deleted_at timestamp with time zone, metadata jsonb ); - -ALTER TABLE public.product_option_values - OWNER TO postgres; - --- --- Name: product_sales_channel; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.product_sales_channels ( - product_id character varying NOT NULL, - sales_channel_id character varying NOT NULL + product_id uuid NOT NULL, + sales_channel_id uuid NOT NULL ); - -ALTER TABLE public.product_sales_channels - OWNER TO postgres; - --- --- Name: product_tag; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.product_tags ( - id character varying NOT NULL, + id uuid NOT NULL, value character varying NOT NULL, created_at timestamp with time zone DEFAULT now() NOT NULL, updated_at timestamp with time zone DEFAULT now() NOT NULL, @@ -1604,48 +1022,24 @@ CREATE TABLE public.product_tags metadata jsonb ); - -ALTER TABLE public.product_tags - OWNER TO postgres; - --- --- Name: product_tags; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.product_to_tags ( - product_id character varying NOT NULL, - product_tag_id character varying NOT NULL + product_id uuid NOT NULL, + product_tag_id uuid NOT NULL ); - -ALTER TABLE public.product_to_tags - OWNER TO postgres; - --- --- Name: product_tax_rate; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.product_tax_rates ( - product_id character varying NOT NULL, - rate_id character varying NOT NULL, + product_id uuid NOT NULL, + rate_id uuid NOT NULL, created_at timestamp with time zone DEFAULT now() NOT NULL, updated_at timestamp with time zone DEFAULT now() NOT NULL, metadata jsonb ); - -ALTER TABLE public.product_tax_rates - OWNER TO postgres; - --- --- Name: product_type; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.product_types ( - id character varying NOT NULL, + id uuid NOT NULL, value character varying NOT NULL, created_at timestamp with time zone DEFAULT now() NOT NULL, updated_at timestamp with time zone DEFAULT now() NOT NULL, @@ -1653,36 +1047,20 @@ CREATE TABLE public.product_types metadata jsonb ); - -ALTER TABLE public.product_types - OWNER TO postgres; - --- --- Name: product_type_tax_rate; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.product_type_tax_rates ( - product_type_id character varying NOT NULL, - rate_id character varying NOT NULL, + product_type_id uuid NOT NULL, + rate_id uuid NOT NULL, created_at timestamp with time zone DEFAULT now() NOT NULL, updated_at timestamp with time zone DEFAULT now() NOT NULL, metadata jsonb ); - -ALTER TABLE public.product_type_tax_rates - OWNER TO postgres; - --- --- Name: product_variant; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.product_variants ( - id character varying NOT NULL, + id uuid NOT NULL, title character varying NOT NULL, - product_id character varying NOT NULL, + product_id uuid NOT NULL, sku character varying, barcode character varying, ean character varying, @@ -1705,17 +1083,9 @@ CREATE TABLE public.product_variants variant_rank integer DEFAULT 0 ); - -ALTER TABLE public.product_variants - OWNER TO postgres; - --- --- Name: product_variant_inventory_item; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.product_variant_inventory_items ( - id character varying NOT NULL, + id uuid NOT NULL, created_at timestamp with time zone DEFAULT now() NOT NULL, updated_at timestamp with time zone DEFAULT now() NOT NULL, inventory_item_id text NOT NULL, @@ -1724,17 +1094,9 @@ CREATE TABLE public.product_variant_inventory_items deleted_at timestamp with time zone ); - -ALTER TABLE public.product_variant_inventory_items - OWNER TO postgres; - --- --- Name: publishable_api_key; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.publishable_api_keys ( - id character varying NOT NULL, + id uuid NOT NULL, created_at timestamp with time zone DEFAULT now() NOT NULL, updated_at timestamp with time zone DEFAULT now() NOT NULL, created_by character varying, @@ -1743,35 +1105,19 @@ CREATE TABLE public.publishable_api_keys title character varying NOT NULL ); - -ALTER TABLE public.publishable_api_keys - OWNER TO postgres; - --- --- Name: publishable_api_key_sales_channel; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.publishable_api_key_sales_channels ( - sales_channel_id character varying NOT NULL, - publishable_key_id character varying NOT NULL + sales_channel_id uuid NOT NULL, + publishable_key_id uuid NOT NULL ); - -ALTER TABLE public.publishable_api_key_sales_channels - OWNER TO postgres; - --- --- Name: refund; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.refunds ( - id character varying NOT NULL, + id uuid NOT NULL, order_id character varying, amount integer NOT NULL, note character varying, - reason public.refund_reasons NOT NULL, + reason public.refund_reasons NOT NULL, created_at timestamp with time zone DEFAULT now() NOT NULL, updated_at timestamp with time zone DEFAULT now() NOT NULL, metadata jsonb, @@ -1779,17 +1125,9 @@ CREATE TABLE public.refunds payment_id character varying ); - -ALTER TABLE public.refunds - OWNER TO postgres; - --- --- Name: region; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.regions ( - id character varying NOT NULL, + id uuid NOT NULL, name character varying NOT NULL, currency_code character varying NOT NULL, tax_rate real NOT NULL, @@ -1803,45 +1141,21 @@ CREATE TABLE public.regions tax_provider_id character varying ); - -ALTER TABLE public.regions - OWNER TO postgres; - --- --- Name: region_fulfillment_providers; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.region_fulfillment_providers ( - region_id character varying NOT NULL, - provider_id character varying NOT NULL + region_id uuid NOT NULL, + provider_id uuid NOT NULL ); - -ALTER TABLE public.region_fulfillment_providers - OWNER TO postgres; - --- --- Name: region_payment_providers; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.region_payment_providers ( - region_id character varying NOT NULL, - provider_id character varying NOT NULL + region_id uuid NOT NULL, + provider_id uuid NOT NULL ); - -ALTER TABLE public.region_payment_providers - OWNER TO postgres; - --- --- Name: return; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.returns ( - id character varying NOT NULL, + id uuid NOT NULL, status public.return_statuses DEFAULT 'requested'::public.return_statuses NOT NULL, swap_id character varying, order_id character varying, @@ -1857,18 +1171,10 @@ CREATE TABLE public.returns location_id character varying ); - -ALTER TABLE public.returns - OWNER TO postgres; - --- --- Name: return_item; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.return_items ( - return_id character varying NOT NULL, - item_id character varying NOT NULL, + return_id uuid NOT NULL, + item_id uuid NOT NULL, quantity integer NOT NULL, is_requested boolean DEFAULT true NOT NULL, requested_quantity integer, @@ -1878,17 +1184,9 @@ CREATE TABLE public.return_items note character varying ); - -ALTER TABLE public.return_items - OWNER TO postgres; - --- --- Name: return_reason; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.return_reasons ( - id character varying NOT NULL, + id uuid NOT NULL, value character varying NOT NULL, label character varying NOT NULL, description character varying, @@ -1899,17 +1197,9 @@ CREATE TABLE public.return_reasons parent_return_reason_id character varying ); - -ALTER TABLE public.return_reasons - OWNER TO postgres; - --- --- Name: sales_channel; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.sales_channels ( - id character varying NOT NULL, + id uuid NOT NULL, created_at timestamp with time zone DEFAULT now() NOT NULL, updated_at timestamp with time zone DEFAULT now() NOT NULL, deleted_at timestamp with time zone, @@ -1919,17 +1209,9 @@ CREATE TABLE public.sales_channels metadata jsonb ); - -ALTER TABLE public.sales_channels - OWNER TO postgres; - --- --- Name: sales_channel_location; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.sales_channel_locations ( - id character varying NOT NULL, + id uuid NOT NULL, created_at timestamp with time zone DEFAULT now() NOT NULL, updated_at timestamp with time zone DEFAULT now() NOT NULL, sales_channel_id text NOT NULL, @@ -1937,18 +1219,10 @@ CREATE TABLE public.sales_channel_locations deleted_at timestamp with time zone ); - -ALTER TABLE public.sales_channel_locations - OWNER TO postgres; - --- --- Name: shipping_method; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.shipping_methods ( - id character varying NOT NULL, - shipping_option_id character varying NOT NULL, + id uuid NOT NULL, + shipping_option_id uuid NOT NULL, order_id character varying, cart_id character varying, swap_id character varying, @@ -1962,41 +1236,25 @@ CREATE TABLE public.shipping_methods (return_id IS NOT NULL))) ); - -ALTER TABLE public.shipping_methods - OWNER TO postgres; - --- --- Name: shipping_method_tax_line; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.shipping_method_tax_lines ( - id character varying NOT NULL, + id uuid NOT NULL, rate real NOT NULL, name character varying NOT NULL, code character varying, created_at timestamp with time zone DEFAULT now() NOT NULL, updated_at timestamp with time zone DEFAULT now() NOT NULL, metadata jsonb, - shipping_method_id character varying NOT NULL + shipping_method_id uuid NOT NULL ); - -ALTER TABLE public.shipping_method_tax_lines - OWNER TO postgres; - --- --- Name: shipping_option; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.shipping_options ( - id character varying NOT NULL, + id uuid NOT NULL, name character varying NOT NULL, - region_id character varying NOT NULL, - profile_id character varying NOT NULL, - provider_id character varying NOT NULL, + region_id uuid NOT NULL, + profile_id uuid NOT NULL, + provider_id uuid NOT NULL, price_type public.shipping_option_price_types NOT NULL, amount integer, is_return boolean DEFAULT false NOT NULL, @@ -2009,34 +1267,18 @@ CREATE TABLE public.shipping_options CONSTRAINT "CHK_7a367f5901ae0a5b0df75aee38" CHECK ((amount >= 0)) ); - -ALTER TABLE public.shipping_options - OWNER TO postgres; - --- --- Name: shipping_option_requirement; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.shipping_option_requirements ( - id character varying NOT NULL, - shipping_option_id character varying NOT NULL, + id uuid NOT NULL, + shipping_option_id uuid NOT NULL, type public.shipping_option_requirement_types NOT NULL, amount integer NOT NULL, deleted_at timestamp with time zone ); - -ALTER TABLE public.shipping_option_requirements - OWNER TO postgres; - --- --- Name: shipping_profile; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.shipping_profiles ( - id character varying NOT NULL, + id uuid NOT NULL, name character varying NOT NULL, type public.shipping_profile_types NOT NULL, created_at timestamp with time zone DEFAULT now() NOT NULL, @@ -2045,55 +1287,31 @@ CREATE TABLE public.shipping_profiles metadata jsonb ); - -ALTER TABLE public.shipping_profiles - OWNER TO postgres; - --- --- Name: shipping_tax_rate; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.shipping_tax_rates ( - shipping_option_id character varying NOT NULL, - rate_id character varying NOT NULL, + shipping_option_id uuid NOT NULL, + rate_id uuid NOT NULL, created_at timestamp with time zone DEFAULT now() NOT NULL, updated_at timestamp with time zone DEFAULT now() NOT NULL, metadata jsonb ); - -ALTER TABLE public.shipping_tax_rates - OWNER TO postgres; - --- --- Name: staged_job; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.staged_jobs ( - id character varying NOT NULL, + id uuid NOT NULL, event_name character varying NOT NULL, data jsonb NOT NULL, options jsonb DEFAULT '{}'::jsonb NOT NULL ); - -ALTER TABLE public.staged_jobs - OWNER TO postgres; - --- --- Name: store; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.stores ( - id character varying NOT NULL, + id uuid NOT NULL, name character varying DEFAULT 'Bazaar'::character varying NOT NULL, - default_currency_code character varying DEFAULT 'pln'::character varying NOT NULL, + default_currency_code character varying DEFAULT 'pln'::character varying NOT NULL, swap_link_template character varying, - created_at timestamp with time zone DEFAULT now() NOT NULL, - updated_at timestamp with time zone DEFAULT now() NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, metadata jsonb, payment_link_template character varying, invite_link_template character varying, @@ -2101,34 +1319,18 @@ CREATE TABLE public.stores default_location_id character varying ); - -ALTER TABLE public.stores - OWNER TO postgres; - --- --- Name: store_currencies; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.store_currencies ( - store_id character varying NOT NULL, + store_id uuid NOT NULL, currency_code character varying NOT NULL ); - -ALTER TABLE public.store_currencies - OWNER TO postgres; - --- --- Name: swap; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.swaps ( - id character varying NOT NULL, + id uuid NOT NULL, fulfillment_status public.swap_fulfillment_statuses NOT NULL, payment_status public.swap_payment_statuses NOT NULL, - order_id character varying NOT NULL, + order_id uuid NOT NULL, difference_due integer, shipping_address_id character varying, cart_id character varying, @@ -2143,54 +1345,30 @@ CREATE TABLE public.swaps allow_backorder boolean DEFAULT false NOT NULL ); - -ALTER TABLE public.swaps - OWNER TO postgres; - --- --- Name: tax_provider; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.tax_providers ( - id character varying NOT NULL, + id uuid NOT NULL, is_installed boolean DEFAULT true NOT NULL ); - -ALTER TABLE public.tax_providers - OWNER TO postgres; - --- --- Name: tax_rate; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.tax_rates ( - id character varying NOT NULL, + id uuid NOT NULL, rate real, code character varying, name character varying NOT NULL, - region_id character varying NOT NULL, + region_id uuid NOT NULL, created_at timestamp with time zone DEFAULT now() NOT NULL, updated_at timestamp with time zone DEFAULT now() NOT NULL, metadata jsonb ); - -ALTER TABLE public.tax_rates - OWNER TO postgres; - --- --- Name: tracking_link; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.tracking_links ( - id character varying NOT NULL, + id uuid NOT NULL, url character varying, tracking_number character varying NOT NULL, - fulfillment_id character varying NOT NULL, + fulfillment_id uuid NOT NULL, created_at timestamp with time zone DEFAULT now() NOT NULL, updated_at timestamp with time zone DEFAULT now() NOT NULL, deleted_at timestamp with time zone, @@ -2198,17 +1376,9 @@ CREATE TABLE public.tracking_links idempotency_key character varying ); - -ALTER TABLE public.tracking_links - OWNER TO postgres; - --- --- Name: user; Type: TABLE; Schema: public; Owner: postgres --- - CREATE TABLE public.users ( - id character varying NOT NULL, + id uuid NOT NULL, email character varying NOT NULL, first_name character varying, last_name character varying, @@ -2221,3458 +1391,1180 @@ CREATE TABLE public.users role public.user_roles DEFAULT 'member'::public.user_roles ); - -ALTER TABLE ONLY public.countries - ALTER COLUMN id SET DEFAULT nextval('public.country_id_seq'::regclass); - - --- --- Name: draft_order display_id; Type: DEFAULT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.draft_orders - ALTER COLUMN display_id SET DEFAULT nextval('public.draft_order_display_id_seq'::regclass); - - --- --- Name: migrations id; Type: DEFAULT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.migrations - ALTER COLUMN id SET DEFAULT nextval('public.migrations_id_seq'::regclass); - - --- --- Name: order display_id; Type: DEFAULT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.orders - ALTER COLUMN display_id SET DEFAULT nextval('public.order_display_id_seq'::regclass); - - --- --- Name: payment_session OneSelected; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.payment_sessions ADD CONSTRAINT "OneSelected" UNIQUE (cart_id, is_selected); - --- --- Name: money_amount PK_022e49a7e21a8dfb820f788778a; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.money_amounts ADD CONSTRAINT "PK_022e49a7e21a8dfb820f788778a" PRIMARY KEY (id); - --- --- Name: notification_provider PK_0425c2423e2ce9fdfd5c23761d9; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.notification_providers ADD CONSTRAINT "PK_0425c2423e2ce9fdfd5c23761d9" PRIMARY KEY (id); - --- --- Name: store_currencies PK_0f2bff3bccc785c320a4df836de; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.store_currencies ADD CONSTRAINT "PK_0f2bff3bccc785c320a4df836de" PRIMARY KEY (store_id, currency_code); - --- --- Name: order PK_1031171c13130102495201e3e20; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.orders ADD CONSTRAINT "PK_1031171c13130102495201e3e20" PRIMARY KEY (id); - --- --- Name: cart_discounts PK_10bd412c9071ccc0cf555afd9bb; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.cart_discounts ADD CONSTRAINT "PK_10bd412c9071ccc0cf555afd9bb" PRIMARY KEY (cart_id, discount_id); - --- --- Name: product_images PK_10de97980da2e939c4c0e8423f2; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.product_images ADD CONSTRAINT "PK_10de97980da2e939c4c0e8423f2" PRIMARY KEY (product_id, image_id); - --- --- Name: product_tag PK_1439455c6528caa94fcc8564fda; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.product_tags ADD CONSTRAINT "PK_1439455c6528caa94fcc8564fda" PRIMARY KEY (id); - --- --- Name: discount_regions PK_15974566a8b6e04a7c754e85b75; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.discount_regions ADD CONSTRAINT "PK_15974566a8b6e04a7c754e85b75" PRIMARY KEY (discount_id, region_id); - --- --- Name: product_variant PK_1ab69c9935c61f7c70791ae0a9f; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.product_variants ADD CONSTRAINT "PK_1ab69c9935c61f7c70791ae0a9f" PRIMARY KEY (id); - --- --- Name: price_list_customer_groups PK_1afcbe15cc8782dc80c05707df9; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.price_list_customer_groups ADD CONSTRAINT "PK_1afcbe15cc8782dc80c05707df9" PRIMARY KEY (price_list_id, customer_group_id); - --- --- Name: product_tags PK_1cf5c9537e7198df494b71b993f; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.product_to_tags ADD CONSTRAINT "PK_1cf5c9537e7198df494b71b993f" PRIMARY KEY (product_id, product_tag_id); - --- --- Name: idempotency_key PK_213f125e14469be304f9ff1d452; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.idempotency_keys ADD CONSTRAINT "PK_213f125e14469be304f9ff1d452" PRIMARY KEY (id); - --- --- Name: cart_gift_cards PK_2389be82bf0ef3635e2014c9ef1; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.cart_gift_cards ADD CONSTRAINT "PK_2389be82bf0ef3635e2014c9ef1" PRIMARY KEY (cart_id, gift_card_id); - --- --- Name: tax_rate PK_23b71b53f650c0b39e99ccef4fd; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.tax_rates ADD CONSTRAINT "PK_23b71b53f650c0b39e99ccef4fd" PRIMARY KEY (id); - --- --- Name: product_option_value PK_2ab71ed3b21be5800905c621535; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.product_option_values ADD CONSTRAINT "PK_2ab71ed3b21be5800905c621535" PRIMARY KEY (id); - --- --- Name: line_item_adjustment PK_2b1360103753df2dc8257c2c8c3; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.line_item_adjustments ADD CONSTRAINT "PK_2b1360103753df2dc8257c2c8c3" PRIMARY KEY (id); - --- --- Name: shipping_option PK_2e56fddaa65f3a26d402e5d786e; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.shipping_options ADD CONSTRAINT "PK_2e56fddaa65f3a26d402e5d786e" PRIMARY KEY (id); - --- --- Name: product_tax_rate PK_326257ce468df46cd5c8c5922e9; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.product_tax_rates ADD CONSTRAINT "PK_326257ce468df46cd5c8c5922e9" PRIMARY KEY (product_id, rate_id); - --- --- Name: discount_rule_products PK_351c8c92f5d27283c445cd022ee; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.discount_rule_products ADD CONSTRAINT "PK_351c8c92f5d27283c445cd022ee" PRIMARY KEY (discount_rule_id, product_id); - --- --- Name: discount_condition_product_type PK_35d538a5a24399d0df978df12ed; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.discount_condition_product_types ADD CONSTRAINT "PK_35d538a5a24399d0df978df12ed" PRIMARY KEY (product_type_id, condition_id); - --- --- Name: return_item PK_46409dc1dd5f38509b9000c3069; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.return_items ADD CONSTRAINT "PK_46409dc1dd5f38509b9000c3069" PRIMARY KEY (return_id, item_id); - --- --- Name: order_gift_cards PK_49a8ec66a6625d7c2e3526e05b4; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.order_gift_cards ADD CONSTRAINT "PK_49a8ec66a6625d7c2e3526e05b4" PRIMARY KEY (order_id, gift_card_id); - --- --- Name: product_collection PK_49d419fc77d3aed46c835c558ac; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.product_collections ADD CONSTRAINT "PK_49d419fc77d3aed46c835c558ac" PRIMARY KEY (id); - --- --- Name: line_item_tax_line PK_4a0f4322fcd5ce4af85727f89a8; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.line_item_tax_lines ADD CONSTRAINT "PK_4a0f4322fcd5ce4af85727f89a8" PRIMARY KEY (id); - --- --- Name: swap PK_4a10d0f359339acef77e7f986d9; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.swaps ADD CONSTRAINT "PK_4a10d0f359339acef77e7f986d9" PRIMARY KEY (id); - --- --- Name: product_option PK_4cf3c467e9bc764bdd32c4cd938; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.product_options ADD CONSTRAINT "PK_4cf3c467e9bc764bdd32c4cd938" PRIMARY KEY (id); - --- --- Name: fulfillment PK_50c102da132afffae660585981f; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.fulfillments ADD CONSTRAINT "PK_50c102da132afffae660585981f" PRIMARY KEY (id); - --- --- Name: price_list PK_52ea7826468b1c889cb2c28df03; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.price_lists ADD CONSTRAINT "PK_52ea7826468b1c889cb2c28df03" PRIMARY KEY (id); - --- --- Name: claim_item_tags PK_54ab8ce0f7e99167068188fbd81; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.claim_item_tags ADD CONSTRAINT "PK_54ab8ce0f7e99167068188fbd81" PRIMARY KEY (item_id, tag_id); - --- --- Name: shipping_method_tax_line PK_54c94f5908aacbd51cf0a73edb1; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.shipping_method_tax_lines ADD CONSTRAINT "PK_54c94f5908aacbd51cf0a73edb1" PRIMARY KEY (id); - --- --- Name: claim_item PK_5679662039bc4c7c6bc7fa1be2d; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.claim_items ADD CONSTRAINT "PK_5679662039bc4c7c6bc7fa1be2d" PRIMARY KEY (id); - --- --- Name: order_edit PK_58ab6acf2e84b4e827f5f846f7a; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.order_edits ADD CONSTRAINT "PK_58ab6acf2e84b4e827f5f846f7a" PRIMARY KEY (id); - --- --- Name: region_fulfillment_providers PK_5b7d928a1fb50d6803868cfab3a; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.region_fulfillment_providers ADD CONSTRAINT "PK_5b7d928a1fb50d6803868cfab3a" PRIMARY KEY (region_id, provider_id); - --- --- Name: region PK_5f48ffc3af96bc486f5f3f3a6da; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.regions ADD CONSTRAINT "PK_5f48ffc3af96bc486f5f3f3a6da" PRIMARY KEY (id); - --- --- Name: publishable_api_key_sales_channel PK_68eaeb14bdac8954460054c567c; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.publishable_api_key_sales_channels ADD CONSTRAINT "PK_68eaeb14bdac8954460054c567c" PRIMARY KEY (sales_channel_id, publishable_key_id); - --- --- Name: notification PK_705b6c7cdf9b2c2ff7ac7872cb7; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.notifications ADD CONSTRAINT "PK_705b6c7cdf9b2c2ff7ac7872cb7" PRIMARY KEY (id); - --- --- Name: currency PK_723472e41cae44beb0763f4039c; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.currencies ADD CONSTRAINT "PK_723472e41cae44beb0763f4039c" PRIMARY KEY (code); - --- --- Name: claim_tag PK_7761180541142a5926501018d34; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.claim_tags ADD CONSTRAINT "PK_7761180541142a5926501018d34" PRIMARY KEY (id); - --- --- Name: claim_image PK_7c49e44bfe8840ca7d917890101; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.claim_images ADD CONSTRAINT "PK_7c49e44bfe8840ca7d917890101" PRIMARY KEY (id); - --- --- Name: customer_group PK_88e7da3ff7262d9e0a35aa3664e; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.customer_groups ADD CONSTRAINT "PK_88e7da3ff7262d9e0a35aa3664e" PRIMARY KEY (id); - --- --- Name: claim_order PK_8981f5595a4424021466aa4c7a4; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.claim_orders ADD CONSTRAINT "PK_8981f5595a4424021466aa4c7a4" PRIMARY KEY (id); - --- --- Name: migrations PK_8c82d7f526340ab734260ea46be; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.migrations ADD CONSTRAINT "PK_8c82d7f526340ab734260ea46be" PRIMARY KEY (id); - --- --- Name: custom_shipping_option PK_8dfcb5c1172c29eec4a728420cc; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.custom_shipping_options ADD CONSTRAINT "PK_8dfcb5c1172c29eec4a728420cc" PRIMARY KEY (id); - --- --- Name: analytics_config PK_93505647c5d7cb479becb810b0f; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.analytics_configs ADD CONSTRAINT "PK_93505647c5d7cb479becb810b0f" PRIMARY KEY (id); - --- --- Name: return_reason PK_95fd1172973165790903e65660a; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.return_reasons ADD CONSTRAINT "PK_95fd1172973165790903e65660a" PRIMARY KEY (id); - --- --- Name: note PK_96d0c172a4fba276b1bbed43058; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.notes ADD CONSTRAINT "PK_96d0c172a4fba276b1bbed43058" PRIMARY KEY (id); - --- --- Name: discount_condition_product PK_994eb4529fdbf14450d64ec17e8; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.discount_condition_products ADD CONSTRAINT "PK_994eb4529fdbf14450d64ec17e8" PRIMARY KEY (product_id, condition_id); - --- --- Name: product_variant_inventory_item PK_9a1188b8d36f4d198303b4f7efa; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.product_variant_inventory_items ADD CONSTRAINT "PK_9a1188b8d36f4d198303b4f7efa" PRIMARY KEY (id); - --- --- Name: staged_job PK_9a28fb48c46c5509faf43ac8c8d; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.staged_jobs ADD CONSTRAINT "PK_9a28fb48c46c5509faf43ac8c8d" PRIMARY KEY (id); - --- --- Name: publishable_api_key PK_9e613278673a87de92c606b4494; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.publishable_api_keys ADD CONSTRAINT "PK_9e613278673a87de92c606b4494" PRIMARY KEY (id); - --- --- Name: region_payment_providers PK_9fa1e69914d3dd752de6b1da407; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.region_payment_providers ADD CONSTRAINT "PK_9fa1e69914d3dd752de6b1da407" PRIMARY KEY (region_id, provider_id); - --- --- Name: shipping_option_requirement PK_a0ff15442606d9f783602cb23a7; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.shipping_option_requirements ADD CONSTRAINT "PK_a0ff15442606d9f783602cb23a7" PRIMARY KEY (id); - --- --- Name: payment_session PK_a1a91b20f7f3b1e5afb5485cbcd; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.payment_sessions ADD CONSTRAINT "PK_a1a91b20f7f3b1e5afb5485cbcd" PRIMARY KEY (id); - --- --- Name: order_discounts PK_a7418714ffceebc125bf6d8fcfe; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.order_discounts ADD CONSTRAINT "PK_a7418714ffceebc125bf6d8fcfe" PRIMARY KEY (order_id, discount_id); - --- --- Name: customer PK_a7a13f4cacb744524e44dfdad32; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.customers ADD CONSTRAINT "PK_a7a13f4cacb744524e44dfdad32" PRIMARY KEY (id); - --- --- Name: discount_condition_product_tag PK_a95382c1e62205b121aa058682b; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.discount_condition_product_tags ADD CONSTRAINT "PK_a95382c1e62205b121aa058682b" PRIMARY KEY (product_tag_id, condition_id); - --- --- Name: oauth PK_a957b894e50eb16b969c0640a8d; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.oauth ADD CONSTRAINT "PK_a957b894e50eb16b969c0640a8d" PRIMARY KEY (id); - --- --- Name: discount_rule PK_ac2c280de3701b2d66f6817f760; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.discount_rules ADD CONSTRAINT "PK_ac2c280de3701b2d66f6817f760" PRIMARY KEY (id); - --- --- Name: gift_card PK_af4e338d2d41035042843ad641f; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.gift_cards ADD CONSTRAINT "PK_af4e338d2d41035042843ad641f" PRIMARY KEY (id); - --- --- Name: sales_channel_location PK_afd2c2c52634bc8280a9c9ee533; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.sales_channel_locations ADD CONSTRAINT "PK_afd2c2c52634bc8280a9c9ee533" PRIMARY KEY (id); - --- --- Name: tax_provider PK_b198bf82ba6a317c11763d99b99; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.tax_providers ADD CONSTRAINT "PK_b198bf82ba6a317c11763d99b99" PRIMARY KEY (id); - --- --- Name: discount_condition_product_collection PK_b3508fc787aa4a38705866cbb6d; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.discount_condition_product_collections ADD CONSTRAINT "PK_b3508fc787aa4a38705866cbb6d" PRIMARY KEY (product_collection_id, condition_id); - --- --- Name: shipping_method PK_b9b0adfad3c6b99229c1e7d4865; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.shipping_methods ADD CONSTRAINT "PK_b9b0adfad3c6b99229c1e7d4865" PRIMARY KEY (id); - --- --- Name: fulfillment_item PK_bc3e8a388de75db146a249922e0; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.fulfillment_items ADD CONSTRAINT "PK_bc3e8a388de75db146a249922e0" PRIMARY KEY (fulfillment_id, item_id); - --- --- Name: shipping_tax_rate PK_bcd93b14d7e2695365d383f5eae; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.shipping_tax_rates ADD CONSTRAINT "PK_bcd93b14d7e2695365d383f5eae" PRIMARY KEY (shipping_option_id, rate_id); - --- --- Name: fulfillment_provider PK_beb35a6de60a6c4f91d5ae57e44; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.fulfillment_providers ADD CONSTRAINT "PK_beb35a6de60a6c4f91d5ae57e44" PRIMARY KEY (id); - --- --- Name: product PK_bebc9158e480b949565b4dc7a82; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.products ADD CONSTRAINT "PK_bebc9158e480b949565b4dc7a82" PRIMARY KEY (id); - --- --- Name: country PK_bf6e37c231c4f4ea56dcd887269; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.countries ADD CONSTRAINT "PK_bf6e37c231c4f4ea56dcd887269" PRIMARY KEY (id); - --- --- Name: cart PK_c524ec48751b9b5bcfbf6e59be7; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.carts ADD CONSTRAINT "PK_c524ec48751b9b5bcfbf6e59be7" PRIMARY KEY (id); - --- --- Name: shipping_profile PK_c8120e4543a5a3a121f2968a1ec; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.shipping_profiles ADD CONSTRAINT "PK_c8120e4543a5a3a121f2968a1ec" PRIMARY KEY (id); - --- --- Name: return PK_c8ad68d13e76d75d803b5aeebc4; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.returns ADD CONSTRAINT "PK_c8ad68d13e76d75d803b5aeebc4" PRIMARY KEY (id); - --- --- Name: user PK_cace4a159ff9f2512dd42373760; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.users ADD CONSTRAINT "PK_cace4a159ff9f2512dd42373760" PRIMARY KEY (id); - --- --- Name: line_item PK_cce6b13e67fa506d1d9618ac68b; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.line_items ADD CONSTRAINT "PK_cce6b13e67fa506d1d9618ac68b" PRIMARY KEY (id); - --- --- Name: discount_condition_customer_group PK_cdc8b2277169a16b8b7d4c73e0e; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.discount_condition_customer_groups ADD CONSTRAINT "PK_cdc8b2277169a16b8b7d4c73e0e" PRIMARY KEY (customer_group_id, condition_id); - --- --- Name: gift_card_transaction PK_cfb5b4ba5447a507aef87d73fe7; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.gift_card_transactions ADD CONSTRAINT "PK_cfb5b4ba5447a507aef87d73fe7" PRIMARY KEY (id); - --- --- Name: discount PK_d05d8712e429673e459e7f1cddb; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.discounts ADD CONSTRAINT "PK_d05d8712e429673e459e7f1cddb" PRIMARY KEY (id); - --- --- Name: sales_channel PK_d1eb0b923ea5a0eb1e0916191f1; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.sales_channels ADD CONSTRAINT "PK_d1eb0b923ea5a0eb1e0916191f1" PRIMARY KEY (id); - --- --- Name: image PK_d6db1ab4ee9ad9dbe86c64e4cc3; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.images ADD CONSTRAINT "PK_d6db1ab4ee9ad9dbe86c64e4cc3" PRIMARY KEY (id); - --- --- Name: order_item_change PK_d6eb138f77ffdee83567b85af0c; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.order_item_changes ADD CONSTRAINT "PK_d6eb138f77ffdee83567b85af0c" PRIMARY KEY (id); - --- --- Name: address PK_d92de1f82754668b5f5f5dd4fd5; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.addresses ADD CONSTRAINT "PK_d92de1f82754668b5f5f5dd4fd5" PRIMARY KEY (id); - --- --- Name: product_type_tax_rate PK_ddc9242de1d99bc7674969289f0; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.product_type_tax_rates ADD CONSTRAINT "PK_ddc9242de1d99bc7674969289f0" PRIMARY KEY (product_type_id, rate_id); - --- --- Name: product_type PK_e0843930fbb8854fe36ca39dae1; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.product_types ADD CONSTRAINT "PK_e0843930fbb8854fe36ca39dae1" PRIMARY KEY (id); - --- --- Name: customer_group_customers PK_e28a55e34ad1e2d3df9a0ac86d3; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.customer_group_customers ADD CONSTRAINT "PK_e28a55e34ad1e2d3df9a0ac86d3" PRIMARY KEY (customer_group_id, customer_id); - --- --- Name: batch_job PK_e57f84d485145d5be96bc6d871e; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.batch_jobs ADD CONSTRAINT "PK_e57f84d485145d5be96bc6d871e" PRIMARY KEY (id); - --- --- Name: discount_condition PK_e6b81d83133ddc21a2baf2e2204; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.discount_conditions ADD CONSTRAINT "PK_e6b81d83133ddc21a2baf2e2204" PRIMARY KEY (id); - --- --- Name: payment_provider PK_ea94f42b6c88e9191c3649d7522; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.payment_providers ADD CONSTRAINT "PK_ea94f42b6c88e9191c3649d7522" PRIMARY KEY (id); - --- --- Name: refund PK_f1cefa2e60d99b206c46c1116e5; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.refunds ADD CONSTRAINT "PK_f1cefa2e60d99b206c46c1116e5" PRIMARY KEY (id); - --- --- Name: store PK_f3172007d4de5ae8e7692759d79; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.stores ADD CONSTRAINT "PK_f3172007d4de5ae8e7692759d79" PRIMARY KEY (id); - --- --- Name: draft_order PK_f478946c183d98f8d88a94cfcd7; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.draft_orders ADD CONSTRAINT "PK_f478946c183d98f8d88a94cfcd7" PRIMARY KEY (id); - --- --- Name: invite PK_fc9fa190e5a3c5d80604a4f63e1; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.invites ADD CONSTRAINT "PK_fc9fa190e5a3c5d80604a4f63e1" PRIMARY KEY (id); - --- --- Name: payment PK_fcaec7df5adf9cac408c686b2ab; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.payments ADD CONSTRAINT "PK_fcaec7df5adf9cac408c686b2ab" PRIMARY KEY (id); - --- --- Name: tracking_link PK_fcfd77feb9012ec2126d7c0bfb6; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.tracking_links ADD CONSTRAINT "PK_fcfd77feb9012ec2126d7c0bfb6" PRIMARY KEY (id); - --- --- Name: product_sales_channel PK_fd29b6a8bd641052628dee19583; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.product_sales_channels ADD CONSTRAINT "PK_fd29b6a8bd641052628dee19583" PRIMARY KEY (product_id, sales_channel_id); - --- --- Name: payment_collection PK_payment_collection_id; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.payment_collections ADD CONSTRAINT "PK_payment_collection_id" PRIMARY KEY (id); - --- --- Name: payment_collection_payments PK_payment_collection_payments; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.payment_collection_payments ADD CONSTRAINT "PK_payment_collection_payments" PRIMARY KEY (payment_collection_id, payment_id); - --- --- Name: payment_collection_sessions PK_payment_collection_sessions; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.payment_collection_sessions ADD CONSTRAINT "PK_payment_collection_sessions" PRIMARY KEY (payment_collection_id, payment_session_id); - --- --- Name: product_category PK_qgguwbn1cwstxk93efl0px9oqwt; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.product_categories ADD CONSTRAINT "PK_qgguwbn1cwstxk93efl0px9oqwt" PRIMARY KEY (id); - --- --- Name: shipping_method REL_1d9ad62038998c3a85c77a53cf; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.shipping_methods ADD CONSTRAINT "REL_1d9ad62038998c3a85c77a53cf" UNIQUE (return_id); - --- --- Name: swap REL_402e8182bc553e082f6380020b; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.swaps ADD CONSTRAINT "REL_402e8182bc553e082f6380020b" UNIQUE (cart_id); - --- --- Name: draft_order REL_5bd11d0e2a9628128e2c26fd0a; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.draft_orders ADD CONSTRAINT "REL_5bd11d0e2a9628128e2c26fd0a" UNIQUE (cart_id); - --- --- Name: order_item_change REL_5f9688929761f7df108b630e64; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.order_item_changes ADD CONSTRAINT "REL_5f9688929761f7df108b630e64" UNIQUE (line_item_id); - --- --- Name: customer REL_8abe81b9aac151ae60bf507ad1; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.customers ADD CONSTRAINT "REL_8abe81b9aac151ae60bf507ad1" UNIQUE (billing_address_id); - --- --- Name: draft_order REL_8f6dd6c49202f1466ebf21e77d; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.draft_orders ADD CONSTRAINT "REL_8f6dd6c49202f1466ebf21e77d" UNIQUE (order_id); - --- --- Name: cart REL_9d1a161434c610aae7c3df2dc7; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.carts ADD CONSTRAINT "REL_9d1a161434c610aae7c3df2dc7" UNIQUE (payment_id); - --- --- Name: return REL_bad82d7bff2b08b87094bfac3d; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.returns ADD CONSTRAINT "REL_bad82d7bff2b08b87094bfac3d" UNIQUE (swap_id); - --- --- Name: payment REL_c17aff091441b7c25ec3d68d36; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.payments ADD CONSTRAINT "REL_c17aff091441b7c25ec3d68d36" UNIQUE (swap_id); - --- --- Name: order REL_c99a206eb11ad45f6b7f04f2dc; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.orders ADD CONSTRAINT "REL_c99a206eb11ad45f6b7f04f2dc" UNIQUE (cart_id); - --- --- Name: custom_shipping_option UQ_0f838b122a9a01d921aa1cdb669; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.custom_shipping_options ADD CONSTRAINT "UQ_0f838b122a9a01d921aa1cdb669" UNIQUE (shipping_option_id, cart_id); - --- --- Name: line_item_tax_line UQ_3c2af51043ed7243e7d9775a2ad; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.line_item_tax_lines ADD CONSTRAINT "UQ_3c2af51043ed7243e7d9775a2ad" UNIQUE (item_id, code); - --- --- Name: order_item_change UQ_5b7a99181e4db2ea821be0b6196; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.order_item_changes ADD CONSTRAINT "UQ_5b7a99181e4db2ea821be0b6196" UNIQUE (order_edit_id, original_line_item_id); - --- --- Name: store UQ_61b0f48cccbb5f41c750bac7286; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.stores ADD CONSTRAINT "UQ_61b0f48cccbb5f41c750bac7286" UNIQUE (default_sales_channel_id); - --- --- Name: return UQ_71773d56eb2bacb922bc3283398; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.returns ADD CONSTRAINT "UQ_71773d56eb2bacb922bc3283398" UNIQUE (claim_order_id); - --- --- Name: order UQ_727b872f86c7378474a8fa46147; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.orders ADD CONSTRAINT "UQ_727b872f86c7378474a8fa46147" UNIQUE (draft_order_id); - --- --- Name: product_variant_inventory_item UQ_c9be7c1b11a1a729eb51d1b6bca; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.product_variant_inventory_items ADD CONSTRAINT "UQ_c9be7c1b11a1a729eb51d1b6bca" UNIQUE (variant_id, inventory_item_id); - --- --- Name: shipping_method_tax_line UQ_cd147fca71e50bc954139fa3104; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.shipping_method_tax_lines ADD CONSTRAINT "UQ_cd147fca71e50bc954139fa3104" UNIQUE (shipping_method_id, code); - --- --- Name: order_item_change UQ_da93cee3ca0dd50a5246268c2e9; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.order_item_changes ADD CONSTRAINT "UQ_da93cee3ca0dd50a5246268c2e9" UNIQUE (order_edit_id, line_item_id); - --- --- Name: customer UQ_unique_email_for_guests_and_customer_accounts; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.customers ADD CONSTRAINT "UQ_unique_email_for_guests_and_customer_accounts" UNIQUE (email, has_account); - --- --- Name: discount_condition dctypeuniq; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.discount_conditions ADD CONSTRAINT dctypeuniq UNIQUE (type, operator, discount_rule_id); - --- --- Name: gift_card_transaction gcuniq; Type: CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.gift_card_transactions ADD CONSTRAINT gcuniq UNIQUE (gift_card_id, order_id); - --- --- Name: IDX_00605f9d662c06b81c1b60ce24; Type: INDEX; Schema: public; Owner: postgres --- - CREATE UNIQUE INDEX "IDX_00605f9d662c06b81c1b60ce24" ON public.return_reasons USING btree (value); - --- --- Name: IDX_012a62ba743e427b5ebe9dee18; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_012a62ba743e427b5ebe9dee18" ON public.shipping_option_requirements USING btree (shipping_option_id); - --- --- Name: IDX_01486cc9dc6b36bf658685535f; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_01486cc9dc6b36bf658685535f" ON public.discount_condition_product_tags USING btree (product_tag_id); - --- --- Name: IDX_017d58bf8260c6e1a2588d258e; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_017d58bf8260c6e1a2588d258e" ON public.claim_orders USING btree (shipping_address_id); - --- --- Name: IDX_045d4a149c09f4704e0bc08dd4; Type: INDEX; Schema: public; Owner: postgres --- - CREATE UNIQUE INDEX "IDX_045d4a149c09f4704e0bc08dd4" ON public.product_variants USING btree (barcode) WHERE (deleted_at IS NULL); - --- --- Name: IDX_0fb38b6d167793192bc126d835; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_0fb38b6d167793192bc126d835" ON public.cart_gift_cards USING btree (gift_card_id); - --- --- Name: IDX_0fc1ec4e3db9001ad60c19daf1; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_0fc1ec4e3db9001ad60c19daf1" ON public.order_discounts USING btree (discount_id); - --- --- Name: IDX_118e3c48f09a7728f41023c94e; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_118e3c48f09a7728f41023c94e" ON public.line_items USING btree (claim_order_id); - --- --- Name: IDX_19b0c6293443d1b464f604c331; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_19b0c6293443d1b464f604c331" ON public.orders USING btree (shipping_address_id); - --- --- Name: IDX_1d04aebeabb6a89f87e536a124; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_1d04aebeabb6a89f87e536a124" ON public.product_tax_rates USING btree (product_id); - --- --- Name: IDX_1d9ad62038998c3a85c77a53cf; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_1d9ad62038998c3a85c77a53cf" ON public.shipping_methods USING btree (return_id); - --- --- Name: IDX_21683a063fe82dafdf681ecc9c; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_21683a063fe82dafdf681ecc9c" ON public.product_to_tags USING btree (product_tag_id); - --- --- Name: IDX_21cbfedd83d736d86f4c6f4ce5; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_21cbfedd83d736d86f4c6f4ce5" ON public.claim_images USING btree (claim_item_id); - --- --- Name: IDX_2212515ba306c79f42c46a99db; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_2212515ba306c79f42c46a99db" ON public.product_images USING btree (image_id); - --- --- Name: IDX_242205c81c1152fab1b6e84847; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_242205c81c1152fab1b6e84847" ON public.carts USING btree (customer_id); - --- --- Name: IDX_2484cf14c437a04586b07e7ddd; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_2484cf14c437a04586b07e7ddd" ON public.product_tax_rates USING btree (rate_id); - --- --- Name: IDX_25a3138bb236f63d9bb6c8ff11; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_25a3138bb236f63d9bb6c8ff11" ON public.product_type_tax_rates USING btree (product_type_id); - --- --- Name: IDX_27283ee631862266d0f1c68064; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_27283ee631862266d0f1c68064" ON public.line_items USING btree (cart_id); - --- --- Name: IDX_2ca8cfbdafb998ecfd6d340389; Type: INDEX; Schema: public; Owner: postgres --- - CREATE UNIQUE INDEX "IDX_2ca8cfbdafb998ecfd6d340389" ON public.product_variants USING btree (sku) WHERE (deleted_at IS NULL); - --- --- Name: IDX_2f41b20a71f30e60471d7e3769; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_2f41b20a71f30e60471d7e3769" ON public.line_item_adjustments USING btree (discount_id); - --- --- Name: IDX_3287f98befad26c3a7dab088cf; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_3287f98befad26c3a7dab088cf" ON public.notes USING btree (resource_id); - --- --- Name: IDX_346e0016cf045b998074774764; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_346e0016cf045b998074774764" ON public.shipping_tax_rates USING btree (rate_id); - --- --- Name: IDX_37341bad297fe5cca91f921032; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_37341bad297fe5cca91f921032" ON public.product_sales_channels USING btree (sales_channel_id); - --- --- Name: IDX_379ca70338ce9991f3affdeedf; Type: INDEX; Schema: public; Owner: postgres --- - CREATE UNIQUE INDEX "IDX_379ca70338ce9991f3affdeedf" ON public.analytics_configs USING btree (id, user_id) WHERE (deleted_at IS NULL); - --- --- Name: IDX_37f361c38a18d12a3fa3158d0c; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_37f361c38a18d12a3fa3158d0c" ON public.region_fulfillment_providers USING btree (provider_id); - --- --- Name: IDX_3a6947180aeec283cd92c59ebb; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_3a6947180aeec283cd92c59ebb" ON public.region_payment_providers USING btree (provider_id); - --- --- Name: IDX_3c6412d076292f439269abe1a2; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_3c6412d076292f439269abe1a2" ON public.customer_group_customers USING btree (customer_id); - --- --- Name: IDX_3fa354d8d1233ff81097b2fcb6; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_3fa354d8d1233ff81097b2fcb6" ON public.line_items USING btree (swap_id); - --- --- Name: IDX_43a2b24495fe1d9fc2a9c835bc; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_43a2b24495fe1d9fc2a9c835bc" ON public.line_items USING btree (order_id); - --- --- Name: IDX_44090cb11b06174cbcc667e91c; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_44090cb11b06174cbcc667e91c" ON public.custom_shipping_options USING btree (shipping_option_id); - --- --- Name: IDX_4665f17abc1e81dd58330e5854; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_4665f17abc1e81dd58330e5854" ON public.payments USING btree (cart_id); - --- --- Name: IDX_484c329f4783be4e18e5e2ff09; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_484c329f4783be4e18e5e2ff09" ON public.carts USING btree (region_id); - --- --- Name: IDX_4d5f98645a67545d8dea42e2eb; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_4d5f98645a67545d8dea42e2eb" ON public.discount_condition_customer_groups USING btree (customer_group_id); - --- --- Name: IDX_4e0739e5f0244c08d41174ca08; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_4e0739e5f0244c08d41174ca08" ON public.discount_rule_products USING btree (discount_rule_id); - --- --- Name: IDX_4f166bb8c2bfcef2498d97b406; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_4f166bb8c2bfcef2498d97b406" ON public.product_images USING btree (product_id); - --- --- Name: IDX_5077fa54b0d037e984385dfe8a; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_5077fa54b0d037e984385dfe8a" ON public.line_item_tax_lines USING btree (item_id); - --- --- Name: IDX_5267705a43d547e232535b656c; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_5267705a43d547e232535b656c" ON public.shipping_methods USING btree (order_id); - --- --- Name: IDX_52875734e9dd69064f0041f4d9; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_52875734e9dd69064f0041f4d9" ON public.price_list_customer_groups USING btree (price_list_id); - --- --- Name: IDX_52dd74e8c989aa5665ad2852b8; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_52dd74e8c989aa5665ad2852b8" ON public.swaps USING btree (order_id); - --- --- Name: IDX_5371cbaa3be5200f373d24e3d5; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_5371cbaa3be5200f373d24e3d5" ON public.line_items USING btree (variant_id); - --- --- Name: IDX_53cb5605fa42e82b4d47b47bda; Type: INDEX; Schema: public; Owner: postgres --- - CREATE UNIQUE INDEX "IDX_53cb5605fa42e82b4d47b47bda" ON public.gift_cards USING btree (code); - --- --- Name: IDX_5568d3b9ce9f7abeeb37511ecf; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_5568d3b9ce9f7abeeb37511ecf" ON public.orders USING btree (billing_address_id); - --- --- Name: IDX_579e01fb94f4f58db480857e05; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_579e01fb94f4f58db480857e05" ON public.orders USING btree (display_id); - --- --- Name: IDX_5a4d5e1e60f97633547821ec8d; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_5a4d5e1e60f97633547821ec8d" ON public.product_sales_channels USING btree (product_id); - --- --- Name: IDX_5b0c6fc53c574299ecc7f9ee22; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_5b0c6fc53c574299ecc7f9ee22" ON public.product_to_tags USING btree (product_id); - --- --- Name: IDX_5bd11d0e2a9628128e2c26fd0a; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_5bd11d0e2a9628128e2c26fd0a" ON public.draft_orders USING btree (cart_id); - --- --- Name: IDX_5c58105f1752fca0f4ce69f466; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_5c58105f1752fca0f4ce69f466" ON public.shipping_options USING btree (region_id); - --- --- Name: IDX_620330964db8d2999e67b0dbe3; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_620330964db8d2999e67b0dbe3" ON public.customer_group_customers USING btree (customer_group_id); - --- --- Name: IDX_64980511ca32c8e92b417644af; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_64980511ca32c8e92b417644af" ON public.claim_items USING btree (variant_id); - --- --- Name: IDX_6680319ebe1f46d18f106191d5; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_6680319ebe1f46d18f106191d5" ON public.cart_discounts USING btree (cart_id); - --- --- Name: IDX_6b0ce4b4bcfd24491510bf19d1; Type: INDEX; Schema: public; Owner: postgres --- - CREATE UNIQUE INDEX "IDX_6b0ce4b4bcfd24491510bf19d1" ON public.invites USING btree (user_email); - --- --- Name: IDX_6b9c66b5e36f7c827dfaa092f9; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_6b9c66b5e36f7c827dfaa092f9" ON public.carts USING btree (billing_address_id); - --- --- Name: IDX_6e0cad0daef76bb642675910b9; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_6e0cad0daef76bb642675910b9" ON public.claim_items USING btree (item_id); - --- --- Name: IDX_6ef23ce0b1d9cf9b5b833e52b9; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_6ef23ce0b1d9cf9b5b833e52b9" ON public.discount_condition_product_types USING btree (condition_id); - --- --- Name: IDX_6f234f058bbbea810dce1d04d0; Type: INDEX; Schema: public; Owner: postgres --- - CREATE UNIQUE INDEX "IDX_6f234f058bbbea810dce1d04d0" ON public.product_collections USING btree (handle) WHERE (deleted_at IS NULL); - --- --- Name: IDX_71773d56eb2bacb922bc328339; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_71773d56eb2bacb922bc328339" ON public.returns USING btree (claim_order_id); - --- --- Name: IDX_80823b7ae866dc5acae2dac6d2; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_80823b7ae866dc5acae2dac6d2" ON public.products USING btree (profile_id); - --- --- Name: IDX_82a6bbb0b527c20a0002ddcbd6; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_82a6bbb0b527c20a0002ddcbd6" ON public.store_currencies USING btree (currency_code); - --- --- Name: IDX_8486ee16e69013c645d0b8716b; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_8486ee16e69013c645d0b8716b" ON public.discount_condition_customer_groups USING btree (condition_id); - --- --- Name: IDX_8aaa78ba90d3802edac317df86; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_8aaa78ba90d3802edac317df86" ON public.region_payment_providers USING btree (region_id); - --- --- Name: IDX_8abe81b9aac151ae60bf507ad1; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_8abe81b9aac151ae60bf507ad1" ON public.customers USING btree (billing_address_id); - --- --- Name: IDX_8df75ef4f35f217768dc113545; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_8df75ef4f35f217768dc113545" ON public.cart_discounts USING btree (discount_id); - --- --- Name: IDX_8f6dd6c49202f1466ebf21e77d; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_8f6dd6c49202f1466ebf21e77d" ON public.draft_orders USING btree (order_id); - --- --- Name: IDX_900a9c3834257304396b2b0fe7; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_900a9c3834257304396b2b0fe7" ON public.claim_items USING btree (claim_order_id); - --- --- Name: IDX_926ca9f29014af8091722dede0; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_926ca9f29014af8091722dede0" ON public.shipping_method_tax_lines USING btree (shipping_method_id); - --- --- Name: IDX_93caeb1bb70d37c1d36d6701a7; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_93caeb1bb70d37c1d36d6701a7" ON public.custom_shipping_options USING btree (cart_id); - --- --- Name: IDX_9c9614b2f9d01665800ea8dbff; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_9c9614b2f9d01665800ea8dbff" ON public.addresses USING btree (customer_id); - --- --- Name: IDX_9d1a161434c610aae7c3df2dc7; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_9d1a161434c610aae7c3df2dc7" ON public.carts USING btree (payment_id); - --- --- Name: IDX_a0b05dc4257abe639cb75f8eae; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_a0b05dc4257abe639cb75f8eae" ON public.discount_condition_product_collections USING btree (product_collection_id); - --- --- Name: IDX_a0e206bfaed3cb63c186091734; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_a0e206bfaed3cb63c186091734" ON public.shipping_options USING btree (provider_id); - --- --- Name: IDX_a1c4f9cfb599ad1f0db39cadd5; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_a1c4f9cfb599ad1f0db39cadd5" ON public.discount_condition_product_collections USING btree (condition_id); - --- --- Name: IDX_a21a7ffbe420d492eb46c305fe; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_a21a7ffbe420d492eb46c305fe" ON public.discount_regions USING btree (region_id); - --- --- Name: IDX_a421bf4588d0004a9b0c0fe84f; Type: INDEX; Schema: public; Owner: postgres --- - CREATE UNIQUE INDEX "IDX_a421bf4588d0004a9b0c0fe84f" ON public.idempotency_keys USING btree (idempotency_key); - --- --- Name: IDX_a52e234f729db789cf473297a5; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_a52e234f729db789cf473297a5" ON public.fulfillments USING btree (swap_id); - --- --- Name: IDX_aa16f61348be02dd07ce3fc54e; Type: INDEX; Schema: public; Owner: postgres --- - CREATE UNIQUE INDEX "IDX_aa16f61348be02dd07ce3fc54e" ON public.product_variants USING btree (upc) WHERE (deleted_at IS NULL); - --- --- Name: IDX_aac4855eadda71aa1e4b6d7684; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_aac4855eadda71aa1e4b6d7684" ON public.payments USING btree (cart_id) WHERE (canceled_at IS NOT NULL); - --- --- Name: IDX_ac2c280de3701b2d66f6817f76; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_ac2c280de3701b2d66f6817f76" ON public.discounts USING btree (rule_id); - --- --- Name: IDX_b1aac8314662fa6b25569a575b; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_b1aac8314662fa6b25569a575b" ON public.countries USING btree (region_id); - --- --- Name: IDX_b4f4b63d1736689b7008980394; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_b4f4b63d1736689b7008980394" ON public.store_currencies USING btree (store_id); - --- --- Name: IDX_b5b6225539ee8501082fbc0714; Type: INDEX; Schema: public; Owner: postgres --- - CREATE UNIQUE INDEX "IDX_b5b6225539ee8501082fbc0714" ON public.product_variants USING btree (ean) WHERE (deleted_at IS NULL); - --- --- Name: IDX_b5df0f53a74b9d0c0a2b652c88; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_b5df0f53a74b9d0c0a2b652c88" ON public.notifications USING btree (customer_id); - --- --- Name: IDX_b6bcf8c3903097b84e85154eed; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_b6bcf8c3903097b84e85154eed" ON public.gift_cards USING btree (region_id); - --- --- Name: IDX_ba8de19442d86957a3aa3b5006; Type: INDEX; Schema: public; Owner: postgres --- - CREATE UNIQUE INDEX "IDX_ba8de19442d86957a3aa3b5006" ON public.users USING btree (email) WHERE (deleted_at IS NULL); - --- --- Name: IDX_bad82d7bff2b08b87094bfac3d; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_bad82d7bff2b08b87094bfac3d" ON public.returns USING btree (swap_id); - --- --- Name: IDX_be66106a673b88a81c603abe7e; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_be66106a673b88a81c603abe7e" ON public.discount_rule_products USING btree (product_id); - --- --- Name: IDX_be9aea2ccf3567007b6227da4d; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_be9aea2ccf3567007b6227da4d" ON public.line_item_adjustments USING btree (item_id); - --- --- Name: IDX_beb35a6de60a6c4f91d5ae57e4; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_beb35a6de60a6c4f91d5ae57e4" ON public.fulfillments USING btree (provider_id); - --- --- Name: IDX_bf701b88d2041392a288785ada; Type: INDEX; Schema: public; Owner: postgres --- - CREATE UNIQUE INDEX "IDX_bf701b88d2041392a288785ada" ON public.line_item_adjustments USING btree (discount_id, item_id) WHERE (discount_id IS NOT NULL); - --- --- Name: IDX_c17aff091441b7c25ec3d68d36; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_c17aff091441b7c25ec3d68d36" ON public.payments USING btree (swap_id); - --- --- Name: IDX_c2c0f3edf39515bd15432afe6e; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_c2c0f3edf39515bd15432afe6e" ON public.claim_item_tags USING btree (item_id); - --- --- Name: IDX_c49c061b1a686843c5d673506f; Type: INDEX; Schema: public; Owner: postgres --- - CREATE UNIQUE INDEX "IDX_c49c061b1a686843c5d673506f" ON public.oauth USING btree (application_name); - --- --- Name: IDX_c4c3a5225a7a1f0af782c40abc; Type: INDEX; Schema: public; Owner: postgres --- - CREATE UNIQUE INDEX "IDX_c4c3a5225a7a1f0af782c40abc" ON public.customer_groups USING btree (name) WHERE (deleted_at IS NULL); - --- --- Name: IDX_c5516f550433c9b1c2630d787a; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_c5516f550433c9b1c2630d787a" ON public.price_list_customer_groups USING btree (customer_group_id); - --- --- Name: IDX_c556e14eff4d6f03db593df955; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_c556e14eff4d6f03db593df955" ON public.region_fulfillment_providers USING btree (region_id); - --- --- Name: IDX_c759f53b2e48e8cfb50638fe4e; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_c759f53b2e48e8cfb50638fe4e" ON public.discount_condition_products USING btree (product_id); - --- --- Name: IDX_c951439af4c98bf2bd7fb8726c; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_c951439af4c98bf2bd7fb8726c" ON public.shipping_options USING btree (profile_id); - --- --- Name: IDX_c99a206eb11ad45f6b7f04f2dc; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_c99a206eb11ad45f6b7f04f2dc" ON public.orders USING btree (cart_id); - --- --- Name: IDX_ca67dd080aac5ecf99609960cd; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_ca67dd080aac5ecf99609960cd" ON public.product_variants USING btree (product_id); - --- --- Name: IDX_cd7812c96209c5bdd48a6b858b; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_cd7812c96209c5bdd48a6b858b" ON public.orders USING btree (customer_id); - --- --- Name: IDX_ced15a9a695d2b5db9dabce763; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_ced15a9a695d2b5db9dabce763" ON public.carts USING btree (shipping_address_id); - --- --- Name: IDX_cf9cc6c3f2e6414b992223fff1; Type: INDEX; Schema: public; Owner: postgres --- - CREATE UNIQUE INDEX "IDX_cf9cc6c3f2e6414b992223fff1" ON public.products USING btree (handle) WHERE (deleted_at IS NULL); - --- --- Name: IDX_d18ad72f2fb7c87f075825b6f8; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_d18ad72f2fb7c87f075825b6f8" ON public.payment_sessions USING btree (provider_id); - --- --- Name: IDX_d25ba0787e1510ddc5d442ebcf; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_d25ba0787e1510ddc5d442ebcf" ON public.payment_sessions USING btree (cart_id); - --- --- Name: IDX_d38047a90f3d42f0be7909e8ae; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_d38047a90f3d42f0be7909e8ae" ON public.cart_gift_cards USING btree (cart_id); - --- --- Name: IDX_d4bd17f918fc6c332b74a368c3; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_d4bd17f918fc6c332b74a368c3" ON public.returns USING btree (order_id); - --- --- Name: IDX_d73e55964e0ff2db8f03807d52; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_d73e55964e0ff2db8f03807d52" ON public.fulfillments USING btree (claim_order_id); - --- --- Name: IDX_d783a66d1c91c0858752c933e6; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_d783a66d1c91c0858752c933e6" ON public.shipping_methods USING btree (claim_order_id); - --- --- Name: IDX_d7d441b81012f87d4265fa57d2; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_d7d441b81012f87d4265fa57d2" ON public.gift_card_transactions USING btree (order_id); - --- --- Name: IDX_d92993a7d554d84571f4eea1d1; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_d92993a7d554d84571f4eea1d1" ON public.shipping_methods USING btree (cart_id); - --- --- Name: IDX_dc9bbf9fcb9ba458d25d512811; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_dc9bbf9fcb9ba458d25d512811" ON public.claim_item_tags USING btree (tag_id); - --- --- Name: IDX_df1494d263740fcfb1d09a98fc; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_df1494d263740fcfb1d09a98fc" ON public.notifications USING btree (resource_type); - --- --- Name: IDX_dfc1f02bb0552e79076aa58dbb; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_dfc1f02bb0552e79076aa58dbb" ON public.gift_cards USING btree (order_id); - --- --- Name: IDX_e1fcce2b18dbcdbe0a5ba9a68b; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_e1fcce2b18dbcdbe0a5ba9a68b" ON public.orders USING btree (region_id); - --- --- Name: IDX_e62ff11e4730bb3adfead979ee; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_e62ff11e4730bb3adfead979ee" ON public.order_gift_cards USING btree (order_id); - --- --- Name: IDX_e706deb68f52ab2756119b9e70; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_e706deb68f52ab2756119b9e70" ON public.discount_condition_product_types USING btree (product_type_id); - --- --- Name: IDX_e78901b1131eaf8203d9b1cb5f; Type: INDEX; Schema: public; Owner: postgres --- - CREATE UNIQUE INDEX "IDX_e78901b1131eaf8203d9b1cb5f" ON public.countries USING btree (iso_2); - --- --- Name: IDX_e7b488cebe333f449398769b2c; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_e7b488cebe333f449398769b2c" ON public.order_discounts USING btree (order_id); - --- --- Name: IDX_e87cc617a22ef4edce5601edab; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_e87cc617a22ef4edce5601edab" ON public.draft_orders USING btree (display_id); - --- --- Name: IDX_ea6a358d9ce41c16499aae55f9; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_ea6a358d9ce41c16499aae55f9" ON public.notifications USING btree (resource_id); - --- --- Name: IDX_ea94f42b6c88e9191c3649d752; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_ea94f42b6c88e9191c3649d752" ON public.payments USING btree (provider_id); - --- --- Name: IDX_ec10c54769877840c132260e4a; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_ec10c54769877840c132260e4a" ON public.claim_tags USING btree (value); - --- --- Name: IDX_ece65a774192b34253abc4cd67; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_ece65a774192b34253abc4cd67" ON public.product_type_tax_rates USING btree (rate_id); - --- --- Name: IDX_eec9d9af4ca098e19ea6b499ea; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_eec9d9af4ca098e19ea6b499ea" ON public.refunds USING btree (order_id); - --- --- Name: IDX_efff700651718e452ca9580a62; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_efff700651718e452ca9580a62" ON public.discount_conditions USING btree (discount_rule_id); - --- --- Name: IDX_f05132301e95bdab4ba1cf29a2; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_f05132301e95bdab4ba1cf29a2" ON public.discount_condition_products USING btree (condition_id); - --- --- Name: IDX_f129acc85e346a10eed12b86fc; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_f129acc85e346a10eed12b86fc" ON public.fulfillments USING btree (order_id); - --- --- Name: IDX_f2bb9f71e95b315eb24b2b84cb; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_f2bb9f71e95b315eb24b2b84cb" ON public.order_gift_cards USING btree (gift_card_id); - --- --- Name: IDX_f4194aa81073f3fab8aa86906f; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_f4194aa81073f3fab8aa86906f" ON public.discount_regions USING btree (discount_id); - --- --- Name: IDX_f49e3974465d3c3a33d449d3f3; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_f49e3974465d3c3a33d449d3f3" ON public.claim_orders USING btree (order_id); - --- --- Name: IDX_f5221735ace059250daac9d980; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_f5221735ace059250daac9d980" ON public.payments USING btree (order_id); - --- --- Name: IDX_f65bf52e2239ace276ece2b2f4; Type: INDEX; Schema: public; Owner: postgres --- - CREATE UNIQUE INDEX "IDX_f65bf52e2239ace276ece2b2f4" ON public.discounts USING btree (code) WHERE (deleted_at IS NULL); - --- --- Name: IDX_f672727ab020df6c50fb64c1a7; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_f672727ab020df6c50fb64c1a7" ON public.shipping_tax_rates USING btree (shipping_option_id); - --- --- Name: IDX_f74980b411cf94af523a72af7d; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_f74980b411cf94af523a72af7d" ON public.notes USING btree (resource_type); - --- --- Name: IDX_fb94fa8d5ca940daa2a58139f8; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_fb94fa8d5ca940daa2a58139f8" ON public.shipping_methods USING btree (swap_id); - --- --- Name: IDX_fbb2499551ed074526f3ee3624; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_fbb2499551ed074526f3ee3624" ON public.discount_condition_product_tags USING btree (condition_id); - --- --- Name: IDX_fc963e94854bff2714ca84cd19; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_fc963e94854bff2714ca84cd19" ON public.shipping_methods USING btree (shipping_option_id); - --- --- Name: IDX_money_amount_currency_code; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_money_amount_currency_code" ON public.money_amounts USING btree (currency_code); - --- --- Name: IDX_order_currency_code; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_order_currency_code" ON public.orders USING btree (currency_code); - --- --- Name: IDX_order_edit_order_id; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_order_edit_order_id" ON public.order_edits USING btree (order_id); - --- --- Name: IDX_order_edit_payment_collection_id; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_order_edit_payment_collection_id" ON public.order_edits USING btree (payment_collection_id); - --- --- Name: IDX_payment_collection_currency_code; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_payment_collection_currency_code" ON public.payment_collections USING btree (currency_code) WHERE (deleted_at IS NULL); - --- --- Name: IDX_payment_collection_payments_payment_collection_id; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_payment_collection_payments_payment_collection_id" ON public.payment_collection_payments USING btree (payment_collection_id); - --- --- Name: IDX_payment_collection_payments_payment_id; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_payment_collection_payments_payment_id" ON public.payment_collection_payments USING btree (payment_id); - --- --- Name: IDX_payment_collection_region_id; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_payment_collection_region_id" ON public.payment_collections USING btree (region_id) WHERE (deleted_at IS NULL); - --- --- Name: IDX_payment_collection_sessions_payment_collection_id; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_payment_collection_sessions_payment_collection_id" ON public.payment_collection_sessions USING btree (payment_collection_id); - --- --- Name: IDX_payment_collection_sessions_payment_session_id; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_payment_collection_sessions_payment_session_id" ON public.payment_collection_sessions USING btree (payment_session_id); - --- --- Name: IDX_payment_currency_code; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_payment_currency_code" ON public.payments USING btree (currency_code); - --- --- Name: IDX_pcp_product_category_id; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_pcp_product_category_id" ON public.product_category_products USING btree (product_category_id); - --- --- Name: IDX_pcp_product_id; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_pcp_product_id" ON public.product_category_products USING btree (product_id); - --- --- Name: IDX_product_category_active_public; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_product_category_active_public" ON public.product_categories USING btree (parent_category_id, is_active, is_internal) WHERE ((is_active IS TRUE) AND (is_internal IS FALSE)); - --- --- Name: IDX_product_category_handle; Type: INDEX; Schema: public; Owner: postgres --- - CREATE UNIQUE INDEX "IDX_product_category_handle" ON public.product_categories USING btree (handle); - --- --- Name: IDX_product_category_path; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_product_category_path" ON public.product_categories USING btree (mpath); - --- --- Name: IDX_product_variant_inventory_item_inventory_item_id; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_product_variant_inventory_item_inventory_item_id" ON public.product_variant_inventory_items USING btree (inventory_item_id) WHERE (deleted_at IS NULL); - --- --- Name: IDX_product_variant_inventory_item_variant_id; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_product_variant_inventory_item_variant_id" ON public.product_variant_inventory_items USING btree (variant_id) WHERE (deleted_at IS NULL); - --- --- Name: IDX_refund_payment_id; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_refund_payment_id" ON public.refunds USING btree (payment_id); - --- --- Name: IDX_region_currency_code; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_region_currency_code" ON public.regions USING btree (currency_code); - --- --- Name: IDX_sales_channel_location_location_id; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_sales_channel_location_location_id" ON public.sales_channel_locations USING btree (location_id) WHERE (deleted_at IS NULL); - --- --- Name: IDX_sales_channel_location_sales_channel_id; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX "IDX_sales_channel_location_sales_channel_id" ON public.sales_channel_locations USING btree (sales_channel_id) WHERE (deleted_at IS NULL); - --- --- Name: IDX_upcp_product_id_product_category_id; Type: INDEX; Schema: public; Owner: postgres --- - CREATE UNIQUE INDEX "IDX_upcp_product_id_product_category_id" ON public.product_category_products USING btree (product_category_id, product_id); - --- --- Name: UniqPaymentSessionCartIdProviderId; Type: INDEX; Schema: public; Owner: postgres --- - CREATE UNIQUE INDEX "UniqPaymentSessionCartIdProviderId" ON public.payment_sessions USING btree (cart_id, provider_id) WHERE (cart_id IS NOT NULL); - --- --- Name: UniqProductCategoryParentIdRank; Type: INDEX; Schema: public; Owner: postgres --- - CREATE UNIQUE INDEX "UniqProductCategoryParentIdRank" ON public.product_categories USING btree (parent_category_id, rank); - --- --- Name: UniquePaymentActive; Type: INDEX; Schema: public; Owner: postgres --- - CREATE UNIQUE INDEX "UniquePaymentActive" ON public.payments USING btree (cart_id) WHERE (canceled_at IS NULL); - --- --- Name: idx_gin_product_collection; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX idx_gin_product_collection ON public.product_collections USING gin (title public.gin_trgm_ops) WHERE (deleted_at IS NULL); - --- --- Name: idx_gin_product_description; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX idx_gin_product_description ON public.products USING gin (description public.gin_trgm_ops) WHERE (deleted_at IS NULL); - --- --- Name: idx_gin_product_title; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX idx_gin_product_title ON public.products USING gin (title public.gin_trgm_ops) WHERE (deleted_at IS NULL); - --- --- Name: idx_gin_product_variant_sku; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX idx_gin_product_variant_sku ON public.product_variants USING gin (sku public.gin_trgm_ops) WHERE (deleted_at IS NULL); - --- --- Name: idx_gin_product_variant_title; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX idx_gin_product_variant_title ON public.product_variants USING gin (title public.gin_trgm_ops) WHERE (deleted_at IS NULL); - --- --- Name: idx_money_amount_region_id; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX idx_money_amount_region_id ON public.money_amounts USING btree (region_id); - --- --- Name: idx_money_amount_variant_id; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX idx_money_amount_variant_id ON public.money_amounts USING btree (variant_id); - --- --- Name: idx_product_option_value_option_id; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX idx_product_option_value_option_id ON public.product_option_values USING btree (option_id); - --- --- Name: idx_product_option_value_variant_id; Type: INDEX; Schema: public; Owner: postgres --- - CREATE INDEX idx_product_option_value_variant_id ON public.product_option_values USING btree (variant_id); - --- --- Name: unique_li_original_item_id_order_edit_id; Type: INDEX; Schema: public; Owner: postgres --- - CREATE UNIQUE INDEX unique_li_original_item_id_order_edit_id ON public.line_items USING btree (order_edit_id, original_item_id) WHERE ((original_item_id IS NOT NULL) AND (order_edit_id IS NOT NULL)); - --- --- Name: shipping_option_requirement FK_012a62ba743e427b5ebe9dee18e; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.shipping_option_requirements ADD CONSTRAINT "FK_012a62ba743e427b5ebe9dee18e" FOREIGN KEY (shipping_option_id) REFERENCES public.shipping_options (id); - --- --- Name: discount_condition_product_tag FK_01486cc9dc6b36bf658685535f6; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.discount_condition_product_tags ADD CONSTRAINT "FK_01486cc9dc6b36bf658685535f6" FOREIGN KEY (product_tag_id) REFERENCES public.product_tags (id) ON DELETE CASCADE; - --- --- Name: claim_order FK_017d58bf8260c6e1a2588d258e2; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.claim_orders ADD CONSTRAINT "FK_017d58bf8260c6e1a2588d258e2" FOREIGN KEY (shipping_address_id) REFERENCES public.addresses (id); - --- --- Name: notification FK_0425c2423e2ce9fdfd5c23761d9; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.notifications ADD CONSTRAINT "FK_0425c2423e2ce9fdfd5c23761d9" FOREIGN KEY (provider_id) REFERENCES public.notification_providers (id); - --- --- Name: cart_gift_cards FK_0fb38b6d167793192bc126d835e; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.cart_gift_cards ADD CONSTRAINT "FK_0fb38b6d167793192bc126d835e" FOREIGN KEY (gift_card_id) REFERENCES public.gift_cards (id) ON DELETE CASCADE; - --- --- Name: order_discounts FK_0fc1ec4e3db9001ad60c19daf16; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.order_discounts ADD CONSTRAINT "FK_0fc1ec4e3db9001ad60c19daf16" FOREIGN KEY (discount_id) REFERENCES public.discounts (id) ON DELETE CASCADE; - --- --- Name: line_item FK_118e3c48f09a7728f41023c94ef; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.line_items ADD CONSTRAINT "FK_118e3c48f09a7728f41023c94ef" FOREIGN KEY (claim_order_id) REFERENCES public.claim_orders (id); - --- --- Name: money_amount FK_17a06d728e4cfbc5bd2ddb70af0; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.money_amounts ADD CONSTRAINT "FK_17a06d728e4cfbc5bd2ddb70af0" FOREIGN KEY (variant_id) REFERENCES public.product_variants (id) ON DELETE CASCADE; - --- --- Name: order FK_19b0c6293443d1b464f604c3316; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.orders ADD CONSTRAINT "FK_19b0c6293443d1b464f604c3316" FOREIGN KEY (shipping_address_id) REFERENCES public.addresses (id); - --- --- Name: product_tax_rate FK_1d04aebeabb6a89f87e536a124d; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.product_tax_rates ADD CONSTRAINT "FK_1d04aebeabb6a89f87e536a124d" FOREIGN KEY (product_id) REFERENCES public.products (id) ON DELETE CASCADE; - --- --- Name: shipping_method FK_1d9ad62038998c3a85c77a53cfb; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.shipping_methods ADD CONSTRAINT "FK_1d9ad62038998c3a85c77a53cfb" FOREIGN KEY (return_id) REFERENCES public.returns (id); - --- --- Name: order_edit FK_1f3a251488a91510f57e1bf93cd; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.order_edits ADD CONSTRAINT "FK_1f3a251488a91510f57e1bf93cd" FOREIGN KEY (order_id) REFERENCES public.orders (id); - --- --- Name: product_tags FK_21683a063fe82dafdf681ecc9c4; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.product_to_tags ADD CONSTRAINT "FK_21683a063fe82dafdf681ecc9c4" FOREIGN KEY (product_tag_id) REFERENCES public.product_tags (id) ON DELETE CASCADE; - --- --- Name: claim_image FK_21cbfedd83d736d86f4c6f4ce56; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.claim_images ADD CONSTRAINT "FK_21cbfedd83d736d86f4c6f4ce56" FOREIGN KEY (claim_item_id) REFERENCES public.claim_items (id); - --- --- Name: product_images FK_2212515ba306c79f42c46a99db7; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.product_images ADD CONSTRAINT "FK_2212515ba306c79f42c46a99db7" FOREIGN KEY (image_id) REFERENCES public.images (id) ON DELETE CASCADE; - --- --- Name: return_reason FK_2250c5d9e975987ab212f61a657; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.return_reasons ADD CONSTRAINT "FK_2250c5d9e975987ab212f61a657" FOREIGN KEY (parent_return_reason_id) REFERENCES public.return_reasons (id); - --- --- Name: discount FK_2250c5d9e975987ab212f61a663; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.discounts ADD CONSTRAINT "FK_2250c5d9e975987ab212f61a663" FOREIGN KEY (parent_discount_id) REFERENCES public.discounts (id); - --- --- Name: cart FK_242205c81c1152fab1b6e848470; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.carts ADD CONSTRAINT "FK_242205c81c1152fab1b6e848470" FOREIGN KEY (customer_id) REFERENCES public.customers (id); - --- --- Name: product_tax_rate FK_2484cf14c437a04586b07e7dddb; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.product_tax_rates ADD CONSTRAINT "FK_2484cf14c437a04586b07e7dddb" FOREIGN KEY (rate_id) REFERENCES public.tax_rates (id) ON DELETE CASCADE; - --- --- Name: product_type_tax_rate FK_25a3138bb236f63d9bb6c8ff111; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.product_type_tax_rates ADD CONSTRAINT "FK_25a3138bb236f63d9bb6c8ff111" FOREIGN KEY (product_type_id) REFERENCES public.product_types (id) ON DELETE CASCADE; - --- --- Name: line_item FK_27283ee631862266d0f1c680646; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.line_items ADD CONSTRAINT "FK_27283ee631862266d0f1c680646" FOREIGN KEY (cart_id) REFERENCES public.carts (id); - --- --- Name: line_item_adjustment FK_2f41b20a71f30e60471d7e3769c; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.line_item_adjustments ADD CONSTRAINT "FK_2f41b20a71f30e60471d7e3769c" FOREIGN KEY (discount_id) REFERENCES public.discounts (id); - --- --- Name: shipping_tax_rate FK_346e0016cf045b9980747747645; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.shipping_tax_rates ADD CONSTRAINT "FK_346e0016cf045b9980747747645" FOREIGN KEY (rate_id) REFERENCES public.tax_rates (id) ON DELETE CASCADE; - --- --- Name: notification FK_371db513192c083f48ba63c33be; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.notifications ADD CONSTRAINT "FK_371db513192c083f48ba63c33be" FOREIGN KEY (parent_id) REFERENCES public.notifications (id); - --- --- Name: product_sales_channel FK_37341bad297fe5cca91f921032b; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.product_sales_channels ADD CONSTRAINT "FK_37341bad297fe5cca91f921032b" FOREIGN KEY (sales_channel_id) REFERENCES public.sales_channels (id) ON UPDATE CASCADE ON DELETE CASCADE; - --- --- Name: region_fulfillment_providers FK_37f361c38a18d12a3fa3158d0cf; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.region_fulfillment_providers ADD CONSTRAINT "FK_37f361c38a18d12a3fa3158d0cf" FOREIGN KEY (provider_id) REFERENCES public.fulfillment_providers (id) ON DELETE CASCADE; - --- --- Name: region_payment_providers FK_3a6947180aeec283cd92c59ebb0; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.region_payment_providers ADD CONSTRAINT "FK_3a6947180aeec283cd92c59ebb0" FOREIGN KEY (provider_id) REFERENCES public.payment_providers (id) ON DELETE CASCADE; - --- --- Name: region FK_3bdd5896ec93be2f1c62a3309a5; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.regions ADD CONSTRAINT "FK_3bdd5896ec93be2f1c62a3309a5" FOREIGN KEY (currency_code) REFERENCES public.currencies (code); - --- --- Name: customer_group_customers FK_3c6412d076292f439269abe1a23; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.customer_group_customers ADD CONSTRAINT "FK_3c6412d076292f439269abe1a23" FOREIGN KEY (customer_id) REFERENCES public.customers (id) ON DELETE CASCADE; - --- --- Name: line_item FK_3fa354d8d1233ff81097b2fcb6b; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.line_items ADD CONSTRAINT "FK_3fa354d8d1233ff81097b2fcb6b" FOREIGN KEY (swap_id) REFERENCES public.swaps (id); - --- --- Name: gift_card_transaction FK_3ff5597f1d7e02bba41541846f4; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.gift_card_transactions ADD CONSTRAINT "FK_3ff5597f1d7e02bba41541846f4" FOREIGN KEY (gift_card_id) REFERENCES public.gift_cards (id); - --- --- Name: swap FK_402e8182bc553e082f6380020b4; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.swaps ADD CONSTRAINT "FK_402e8182bc553e082f6380020b4" FOREIGN KEY (cart_id) REFERENCES public.carts (id); - --- --- Name: line_item FK_43a2b24495fe1d9fc2a9c835bc7; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.line_items ADD CONSTRAINT "FK_43a2b24495fe1d9fc2a9c835bc7" FOREIGN KEY (order_id) REFERENCES public.orders (id); - --- --- Name: custom_shipping_option FK_44090cb11b06174cbcc667e91ca; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.custom_shipping_options ADD CONSTRAINT "FK_44090cb11b06174cbcc667e91ca" FOREIGN KEY (shipping_option_id) REFERENCES public.shipping_options (id); - --- --- Name: order_item_change FK_44feeebb258bf4cfa4cc4202281; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.order_item_changes ADD CONSTRAINT "FK_44feeebb258bf4cfa4cc4202281" FOREIGN KEY (order_edit_id) REFERENCES public.order_edits (id); - --- --- Name: payment FK_4665f17abc1e81dd58330e58542; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.payments ADD CONSTRAINT "FK_4665f17abc1e81dd58330e58542" FOREIGN KEY (cart_id) REFERENCES public.carts (id); - --- --- Name: tracking_link FK_471e9e4c96e02ba209a307db32b; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.tracking_links ADD CONSTRAINT "FK_471e9e4c96e02ba209a307db32b" FOREIGN KEY (fulfillment_id) REFERENCES public.fulfillments (id); - --- --- Name: cart FK_484c329f4783be4e18e5e2ff090; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.carts ADD CONSTRAINT "FK_484c329f4783be4e18e5e2ff090" FOREIGN KEY (region_id) REFERENCES public.regions (id); - --- --- Name: product FK_49d419fc77d3aed46c835c558ac; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.products ADD CONSTRAINT "FK_49d419fc77d3aed46c835c558ac" FOREIGN KEY (collection_id) REFERENCES public.product_collections (id); - --- --- Name: discount_condition_customer_group FK_4d5f98645a67545d8dea42e2eb8; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.discount_condition_customer_groups ADD CONSTRAINT "FK_4d5f98645a67545d8dea42e2eb8" FOREIGN KEY (customer_group_id) REFERENCES public.customer_groups (id) ON DELETE CASCADE; - --- --- Name: discount_rule_products FK_4e0739e5f0244c08d41174ca08a; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.discount_rule_products ADD CONSTRAINT "FK_4e0739e5f0244c08d41174ca08a" FOREIGN KEY (discount_rule_id) REFERENCES public.discount_rules (id) ON DELETE CASCADE; - --- --- Name: product_images FK_4f166bb8c2bfcef2498d97b4068; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.product_images ADD CONSTRAINT "FK_4f166bb8c2bfcef2498d97b4068" FOREIGN KEY (product_id) REFERENCES public.products (id) ON DELETE CASCADE; - --- --- Name: line_item_tax_line FK_5077fa54b0d037e984385dfe8ad; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.line_item_tax_lines ADD CONSTRAINT "FK_5077fa54b0d037e984385dfe8ad" FOREIGN KEY (item_id) REFERENCES public.line_items (id); - --- --- Name: shipping_method FK_5267705a43d547e232535b656c2; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.shipping_methods ADD CONSTRAINT "FK_5267705a43d547e232535b656c2" FOREIGN KEY (order_id) REFERENCES public.orders (id); - --- --- Name: price_list_customer_groups FK_52875734e9dd69064f0041f4d92; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.price_list_customer_groups ADD CONSTRAINT "FK_52875734e9dd69064f0041f4d92" FOREIGN KEY (price_list_id) REFERENCES public.price_lists (id) ON UPDATE CASCADE ON DELETE CASCADE; - --- --- Name: swap FK_52dd74e8c989aa5665ad2852b8b; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.swaps ADD CONSTRAINT "FK_52dd74e8c989aa5665ad2852b8b" FOREIGN KEY (order_id) REFERENCES public.orders (id); - --- --- Name: line_item FK_5371cbaa3be5200f373d24e3d5b; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.line_items ADD CONSTRAINT "FK_5371cbaa3be5200f373d24e3d5b" FOREIGN KEY (variant_id) REFERENCES public.product_variants (id); - --- --- Name: order FK_5568d3b9ce9f7abeeb37511ecf2; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.orders ADD CONSTRAINT "FK_5568d3b9ce9f7abeeb37511ecf2" FOREIGN KEY (billing_address_id) REFERENCES public.addresses (id); - --- --- Name: store FK_55beebaa09e947cccca554af222; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.stores ADD CONSTRAINT "FK_55beebaa09e947cccca554af222" FOREIGN KEY (default_currency_code) REFERENCES public.currencies (code); - --- --- Name: product_sales_channel FK_5a4d5e1e60f97633547821ec8d6; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.product_sales_channels ADD CONSTRAINT "FK_5a4d5e1e60f97633547821ec8d6" FOREIGN KEY (product_id) REFERENCES public.products (id) ON UPDATE CASCADE ON DELETE CASCADE; - --- --- Name: product_tags FK_5b0c6fc53c574299ecc7f9ee22e; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.product_to_tags ADD CONSTRAINT "FK_5b0c6fc53c574299ecc7f9ee22e" FOREIGN KEY (product_id) REFERENCES public.products (id) ON DELETE CASCADE; - --- --- Name: draft_order FK_5bd11d0e2a9628128e2c26fd0a6; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.draft_orders ADD CONSTRAINT "FK_5bd11d0e2a9628128e2c26fd0a6" FOREIGN KEY (cart_id) REFERENCES public.carts (id); - --- --- Name: shipping_option FK_5c58105f1752fca0f4ce69f4663; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.shipping_options ADD CONSTRAINT "FK_5c58105f1752fca0f4ce69f4663" FOREIGN KEY (region_id) REFERENCES public.regions (id); - --- --- Name: order_item_change FK_5f9688929761f7df108b630e64a; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.order_item_changes ADD CONSTRAINT "FK_5f9688929761f7df108b630e64a" FOREIGN KEY (line_item_id) REFERENCES public.line_items (id); - --- --- Name: store FK_61b0f48cccbb5f41c750bac7286; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.stores ADD CONSTRAINT "FK_61b0f48cccbb5f41c750bac7286" FOREIGN KEY (default_sales_channel_id) REFERENCES public.sales_channels (id); - --- --- Name: customer_group_customers FK_620330964db8d2999e67b0dbe3e; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.customer_group_customers ADD CONSTRAINT "FK_620330964db8d2999e67b0dbe3e" FOREIGN KEY (customer_group_id) REFERENCES public.customer_groups (id) ON DELETE CASCADE; - --- --- Name: claim_item FK_64980511ca32c8e92b417644afa; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.claim_items ADD CONSTRAINT "FK_64980511ca32c8e92b417644afa" FOREIGN KEY (variant_id) REFERENCES public.product_variants (id); - --- --- Name: cart_discounts FK_6680319ebe1f46d18f106191d59; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.cart_discounts ADD CONSTRAINT "FK_6680319ebe1f46d18f106191d59" FOREIGN KEY (cart_id) REFERENCES public.carts (id) ON DELETE CASCADE; - --- --- Name: cart FK_6b9c66b5e36f7c827dfaa092f94; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.carts ADD CONSTRAINT "FK_6b9c66b5e36f7c827dfaa092f94" FOREIGN KEY (billing_address_id) REFERENCES public.addresses (id); - --- --- Name: address FK_6df8c6bf969a51d24c1980c4ff4; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.addresses ADD CONSTRAINT "FK_6df8c6bf969a51d24c1980c4ff4" FOREIGN KEY (country_code) REFERENCES public.countries (iso_2); - --- --- Name: claim_item FK_6e0cad0daef76bb642675910b9d; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.claim_items ADD CONSTRAINT "FK_6e0cad0daef76bb642675910b9d" FOREIGN KEY (item_id) REFERENCES public.line_items (id); - --- --- Name: discount_condition_product_type FK_6ef23ce0b1d9cf9b5b833e52b9d; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.discount_condition_product_types ADD CONSTRAINT "FK_6ef23ce0b1d9cf9b5b833e52b9d" FOREIGN KEY (condition_id) REFERENCES public.discount_conditions (id) ON DELETE CASCADE; - --- --- Name: order FK_6ff7e874f01b478c115fdd462eb; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.orders ADD CONSTRAINT "FK_6ff7e874f01b478c115fdd462eb" FOREIGN KEY (sales_channel_id) REFERENCES public.sales_channels (id); - --- --- Name: return FK_71773d56eb2bacb922bc3283398; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.returns ADD CONSTRAINT "FK_71773d56eb2bacb922bc3283398" FOREIGN KEY (claim_order_id) REFERENCES public.claim_orders (id); - --- --- Name: order FK_717a141f96b76d794d409f38129; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.orders ADD CONSTRAINT "FK_717a141f96b76d794d409f38129" FOREIGN KEY (currency_code) REFERENCES public.currencies (code); - --- --- Name: product_option_value FK_7234ed737ff4eb1b6ae6e6d7b01; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.product_option_values ADD CONSTRAINT "FK_7234ed737ff4eb1b6ae6e6d7b01" FOREIGN KEY (variant_id) REFERENCES public.product_variants (id) ON DELETE CASCADE; - --- --- Name: order FK_727b872f86c7378474a8fa46147; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.orders ADD CONSTRAINT "FK_727b872f86c7378474a8fa46147" FOREIGN KEY (draft_order_id) REFERENCES public.draft_orders (id); - --- --- Name: return_item FK_7edab75b4fc88ea6d4f2574f087; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.return_items ADD CONSTRAINT "FK_7edab75b4fc88ea6d4f2574f087" FOREIGN KEY (return_id) REFERENCES public.returns (id); - --- --- Name: product FK_80823b7ae866dc5acae2dac6d2c; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.products ADD CONSTRAINT "FK_80823b7ae866dc5acae2dac6d2c" FOREIGN KEY (profile_id) REFERENCES public.shipping_profiles (id); - --- --- Name: store_currencies FK_82a6bbb0b527c20a0002ddcbd60; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.store_currencies ADD CONSTRAINT "FK_82a6bbb0b527c20a0002ddcbd60" FOREIGN KEY (currency_code) REFERENCES public.currencies (code) ON DELETE CASCADE; - --- --- Name: discount_condition_customer_group FK_8486ee16e69013c645d0b8716b6; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.discount_condition_customer_groups ADD CONSTRAINT "FK_8486ee16e69013c645d0b8716b6" FOREIGN KEY (condition_id) REFERENCES public.discount_conditions (id) ON DELETE CASCADE; - --- --- Name: return_item FK_87774591f44564effd8039d7162; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.return_items ADD CONSTRAINT "FK_87774591f44564effd8039d7162" FOREIGN KEY (item_id) REFERENCES public.line_items (id); - --- --- Name: region_payment_providers FK_8aaa78ba90d3802edac317df869; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.region_payment_providers ADD CONSTRAINT "FK_8aaa78ba90d3802edac317df869" FOREIGN KEY (region_id) REFERENCES public.regions (id) ON DELETE CASCADE; - --- --- Name: customer FK_8abe81b9aac151ae60bf507ad15; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.customers ADD CONSTRAINT "FK_8abe81b9aac151ae60bf507ad15" FOREIGN KEY (billing_address_id) REFERENCES public.addresses (id); - --- --- Name: cart_discounts FK_8df75ef4f35f217768dc1135458; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.cart_discounts ADD CONSTRAINT "FK_8df75ef4f35f217768dc1135458" FOREIGN KEY (discount_id) REFERENCES public.discounts (id) ON DELETE CASCADE; - --- --- Name: draft_order FK_8f6dd6c49202f1466ebf21e77da; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.draft_orders ADD CONSTRAINT "FK_8f6dd6c49202f1466ebf21e77da" FOREIGN KEY (order_id) REFERENCES public.orders (id); - --- --- Name: claim_item FK_900a9c3834257304396b2b0fe7c; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.claim_items ADD CONSTRAINT "FK_900a9c3834257304396b2b0fe7c" FOREIGN KEY (claim_order_id) REFERENCES public.claim_orders (id); - --- --- Name: region FK_91f88052197680f9790272aaf5b; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.regions ADD CONSTRAINT "FK_91f88052197680f9790272aaf5b" FOREIGN KEY (tax_provider_id) REFERENCES public.tax_providers (id); - --- --- Name: shipping_method_tax_line FK_926ca9f29014af8091722dede08; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.shipping_method_tax_lines ADD CONSTRAINT "FK_926ca9f29014af8091722dede08" FOREIGN KEY (shipping_method_id) REFERENCES public.shipping_methods (id); - --- --- Name: custom_shipping_option FK_93caeb1bb70d37c1d36d6701a7a; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.custom_shipping_options ADD CONSTRAINT "FK_93caeb1bb70d37c1d36d6701a7a" FOREIGN KEY (cart_id) REFERENCES public.carts (id); - --- --- Name: address FK_9c9614b2f9d01665800ea8dbff7; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.addresses ADD CONSTRAINT "FK_9c9614b2f9d01665800ea8dbff7" FOREIGN KEY (customer_id) REFERENCES public.customers (id); - --- --- Name: cart FK_9d1a161434c610aae7c3df2dc7e; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.carts ADD CONSTRAINT "FK_9d1a161434c610aae7c3df2dc7e" FOREIGN KEY (payment_id) REFERENCES public.payments (id); - --- --- Name: fulfillment_item FK_a033f83cc6bd7701a5687ab4b38; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.fulfillment_items ADD CONSTRAINT "FK_a033f83cc6bd7701a5687ab4b38" FOREIGN KEY (fulfillment_id) REFERENCES public.fulfillments (id); - --- --- Name: discount_condition_product_collection FK_a0b05dc4257abe639cb75f8eae2; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.discount_condition_product_collections ADD CONSTRAINT "FK_a0b05dc4257abe639cb75f8eae2" FOREIGN KEY (product_collection_id) REFERENCES public.product_collections (id) ON DELETE CASCADE; - --- --- Name: shipping_option FK_a0e206bfaed3cb63c1860917347; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.shipping_options ADD CONSTRAINT "FK_a0e206bfaed3cb63c1860917347" FOREIGN KEY (provider_id) REFERENCES public.fulfillment_providers (id); - --- --- Name: discount_condition_product_collection FK_a1c4f9cfb599ad1f0db39cadd5f; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.discount_condition_product_collections ADD CONSTRAINT "FK_a1c4f9cfb599ad1f0db39cadd5f" FOREIGN KEY (condition_id) REFERENCES public.discount_conditions (id) ON DELETE CASCADE; - --- --- Name: discount_regions FK_a21a7ffbe420d492eb46c305fec; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.discount_regions ADD CONSTRAINT "FK_a21a7ffbe420d492eb46c305fec" FOREIGN KEY (region_id) REFERENCES public.regions (id) ON DELETE CASCADE; - --- --- Name: cart FK_a2bd3c26f42e754b9249ba78fd6; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.carts ADD CONSTRAINT "FK_a2bd3c26f42e754b9249ba78fd6" FOREIGN KEY (sales_channel_id) REFERENCES public.sales_channels (id); - --- --- Name: fulfillment FK_a52e234f729db789cf473297a5c; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.fulfillments ADD CONSTRAINT "FK_a52e234f729db789cf473297a5c" FOREIGN KEY (swap_id) REFERENCES public.swaps (id); - --- --- Name: discount FK_ac2c280de3701b2d66f6817f760; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.discounts ADD CONSTRAINT "FK_ac2c280de3701b2d66f6817f760" FOREIGN KEY (rule_id) REFERENCES public.discount_rules (id); - --- --- Name: country FK_b1aac8314662fa6b25569a575bb; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.countries ADD CONSTRAINT "FK_b1aac8314662fa6b25569a575bb" FOREIGN KEY (region_id) REFERENCES public.regions (id); - --- --- Name: money_amount FK_b433e27b7a83e6d12ab26b15b03; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.money_amounts ADD CONSTRAINT "FK_b433e27b7a83e6d12ab26b15b03" FOREIGN KEY (region_id) REFERENCES public.regions (id); - --- --- Name: order_item_change FK_b4d53b8d03c9f5e7d4317e818d9; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.order_item_changes ADD CONSTRAINT "FK_b4d53b8d03c9f5e7d4317e818d9" FOREIGN KEY (original_line_item_id) REFERENCES public.line_items (id); - --- --- Name: store_currencies FK_b4f4b63d1736689b7008980394c; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.store_currencies ADD CONSTRAINT "FK_b4f4b63d1736689b7008980394c" FOREIGN KEY (store_id) REFERENCES public.stores (id) ON DELETE CASCADE; - --- --- Name: notification FK_b5df0f53a74b9d0c0a2b652c88d; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.notifications ADD CONSTRAINT "FK_b5df0f53a74b9d0c0a2b652c88d" FOREIGN KEY (customer_id) REFERENCES public.customers (id); - --- --- Name: gift_card FK_b6bcf8c3903097b84e85154eed3; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.gift_cards ADD CONSTRAINT "FK_b6bcf8c3903097b84e85154eed3" FOREIGN KEY (region_id) REFERENCES public.regions (id); - --- --- Name: tax_rate FK_b95a1e03b051993d208366cb960; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.tax_rates ADD CONSTRAINT "FK_b95a1e03b051993d208366cb960" FOREIGN KEY (region_id) REFERENCES public.regions (id); - --- --- Name: return FK_bad82d7bff2b08b87094bfac3d6; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.returns ADD CONSTRAINT "FK_bad82d7bff2b08b87094bfac3d6" FOREIGN KEY (swap_id) REFERENCES public.swaps (id); - --- --- Name: discount_rule_products FK_be66106a673b88a81c603abe7eb; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.discount_rule_products ADD CONSTRAINT "FK_be66106a673b88a81c603abe7eb" FOREIGN KEY (product_id) REFERENCES public.products (id) ON DELETE CASCADE; - --- --- Name: line_item_adjustment FK_be9aea2ccf3567007b6227da4d2; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.line_item_adjustments ADD CONSTRAINT "FK_be9aea2ccf3567007b6227da4d2" FOREIGN KEY (item_id) REFERENCES public.line_items (id) ON DELETE CASCADE; - --- --- Name: fulfillment FK_beb35a6de60a6c4f91d5ae57e44; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.fulfillments ADD CONSTRAINT "FK_beb35a6de60a6c4f91d5ae57e44" FOREIGN KEY (provider_id) REFERENCES public.fulfillment_providers (id); - --- --- Name: payment FK_c17aff091441b7c25ec3d68d36c; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.payments ADD CONSTRAINT "FK_c17aff091441b7c25ec3d68d36c" FOREIGN KEY (swap_id) REFERENCES public.swaps (id); - --- --- Name: claim_item_tags FK_c2c0f3edf39515bd15432afe6e5; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.claim_item_tags ADD CONSTRAINT "FK_c2c0f3edf39515bd15432afe6e5" FOREIGN KEY (item_id) REFERENCES public.claim_items (id) ON DELETE CASCADE; - --- --- Name: price_list_customer_groups FK_c5516f550433c9b1c2630d787a7; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.price_list_customer_groups ADD CONSTRAINT "FK_c5516f550433c9b1c2630d787a7" FOREIGN KEY (customer_group_id) REFERENCES public.customer_groups (id) ON DELETE CASCADE; - --- --- Name: region_fulfillment_providers FK_c556e14eff4d6f03db593df955e; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.region_fulfillment_providers ADD CONSTRAINT "FK_c556e14eff4d6f03db593df955e" FOREIGN KEY (region_id) REFERENCES public.regions (id) ON DELETE CASCADE; - --- --- Name: discount_condition_product FK_c759f53b2e48e8cfb50638fe4e0; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.discount_condition_products ADD CONSTRAINT "FK_c759f53b2e48e8cfb50638fe4e0" FOREIGN KEY (product_id) REFERENCES public.products (id) ON DELETE CASCADE; - --- --- Name: shipping_option FK_c951439af4c98bf2bd7fb8726cd; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.shipping_options ADD CONSTRAINT "FK_c951439af4c98bf2bd7fb8726cd" FOREIGN KEY (profile_id) REFERENCES public.shipping_profiles (id); - --- --- Name: order FK_c99a206eb11ad45f6b7f04f2dcc; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.orders ADD CONSTRAINT "FK_c99a206eb11ad45f6b7f04f2dcc" FOREIGN KEY (cart_id) REFERENCES public.carts (id); - --- --- Name: product_variant FK_ca67dd080aac5ecf99609960cd2; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.product_variants ADD CONSTRAINT "FK_ca67dd080aac5ecf99609960cd2" FOREIGN KEY (product_id) REFERENCES public.products (id); - --- --- Name: order FK_cd7812c96209c5bdd48a6b858b0; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.orders ADD CONSTRAINT "FK_cd7812c96209c5bdd48a6b858b0" FOREIGN KEY (customer_id) REFERENCES public.customers (id); - --- --- Name: product_option_value FK_cdf4388f294b30a25c627d69fe9; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.product_option_values ADD CONSTRAINT "FK_cdf4388f294b30a25c627d69fe9" FOREIGN KEY (option_id) REFERENCES public.product_options (id); - --- --- Name: cart FK_ced15a9a695d2b5db9dabce763d; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.carts ADD CONSTRAINT "FK_ced15a9a695d2b5db9dabce763d" FOREIGN KEY (shipping_address_id) REFERENCES public.addresses (id); - --- --- Name: payment_session FK_d25ba0787e1510ddc5d442ebcfa; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.payment_sessions ADD CONSTRAINT "FK_d25ba0787e1510ddc5d442ebcfa" FOREIGN KEY (cart_id) REFERENCES public.carts (id); - --- --- Name: cart_gift_cards FK_d38047a90f3d42f0be7909e8aea; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.cart_gift_cards ADD CONSTRAINT "FK_d38047a90f3d42f0be7909e8aea" FOREIGN KEY (cart_id) REFERENCES public.carts (id) ON DELETE CASCADE; - --- --- Name: return FK_d4bd17f918fc6c332b74a368c36; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.returns ADD CONSTRAINT "FK_d4bd17f918fc6c332b74a368c36" FOREIGN KEY (order_id) REFERENCES public.orders (id); - --- --- Name: fulfillment FK_d73e55964e0ff2db8f03807d52e; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.fulfillments ADD CONSTRAINT "FK_d73e55964e0ff2db8f03807d52e" FOREIGN KEY (claim_order_id) REFERENCES public.claim_orders (id); - --- --- Name: return_item FK_d742532378a65022e7ceb328828; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.return_items ADD CONSTRAINT "FK_d742532378a65022e7ceb328828" FOREIGN KEY (reason_id) REFERENCES public.return_reasons (id); - --- --- Name: shipping_method FK_d783a66d1c91c0858752c933e68; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.shipping_methods ADD CONSTRAINT "FK_d783a66d1c91c0858752c933e68" FOREIGN KEY (claim_order_id) REFERENCES public.claim_orders (id); - --- --- Name: gift_card_transaction FK_d7d441b81012f87d4265fa57d24; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.gift_card_transactions ADD CONSTRAINT "FK_d7d441b81012f87d4265fa57d24" FOREIGN KEY (order_id) REFERENCES public.orders (id); - --- --- Name: shipping_method FK_d92993a7d554d84571f4eea1d13; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.shipping_methods ADD CONSTRAINT "FK_d92993a7d554d84571f4eea1d13" FOREIGN KEY (cart_id) REFERENCES public.carts (id); - --- --- Name: claim_item_tags FK_dc9bbf9fcb9ba458d25d512811b; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.claim_item_tags ADD CONSTRAINT "FK_dc9bbf9fcb9ba458d25d512811b" FOREIGN KEY (tag_id) REFERENCES public.claim_tags (id) ON DELETE CASCADE; - --- --- Name: gift_card FK_dfc1f02bb0552e79076aa58dbb0; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.gift_cards ADD CONSTRAINT "FK_dfc1f02bb0552e79076aa58dbb0" FOREIGN KEY (order_id) REFERENCES public.orders (id); - --- --- Name: product FK_e0843930fbb8854fe36ca39dae1; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.products ADD CONSTRAINT "FK_e0843930fbb8854fe36ca39dae1" FOREIGN KEY (type_id) REFERENCES public.product_types (id); - --- --- Name: fulfillment_item FK_e13ff60e74206b747a1896212d1; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.fulfillment_items ADD CONSTRAINT "FK_e13ff60e74206b747a1896212d1" FOREIGN KEY (item_id) REFERENCES public.line_items (id); - --- --- Name: money_amount FK_e15811f81339e4bd8c440aebe1c; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.money_amounts ADD CONSTRAINT "FK_e15811f81339e4bd8c440aebe1c" FOREIGN KEY (currency_code) REFERENCES public.currencies (code); - --- --- Name: order FK_e1fcce2b18dbcdbe0a5ba9a68b8; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.orders ADD CONSTRAINT "FK_e1fcce2b18dbcdbe0a5ba9a68b8" FOREIGN KEY (region_id) REFERENCES public.regions (id); - --- --- Name: order_gift_cards FK_e62ff11e4730bb3adfead979ee2; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.order_gift_cards ADD CONSTRAINT "FK_e62ff11e4730bb3adfead979ee2" FOREIGN KEY (order_id) REFERENCES public.orders (id) ON DELETE CASCADE; - --- --- Name: product_option FK_e634fca34f6b594b87fdbee95f6; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.product_options ADD CONSTRAINT "FK_e634fca34f6b594b87fdbee95f6" FOREIGN KEY (product_id) REFERENCES public.products (id); - --- --- Name: discount_condition_product_type FK_e706deb68f52ab2756119b9e704; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.discount_condition_product_types ADD CONSTRAINT "FK_e706deb68f52ab2756119b9e704" FOREIGN KEY (product_type_id) REFERENCES public.product_types (id) ON DELETE CASCADE; - --- --- Name: order_discounts FK_e7b488cebe333f449398769b2cc; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.order_discounts ADD CONSTRAINT "FK_e7b488cebe333f449398769b2cc" FOREIGN KEY (order_id) REFERENCES public.orders (id) ON DELETE CASCADE; - --- --- Name: product_type_tax_rate FK_ece65a774192b34253abc4cd672; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.product_type_tax_rates ADD CONSTRAINT "FK_ece65a774192b34253abc4cd672" FOREIGN KEY (rate_id) REFERENCES public.tax_rates (id) ON DELETE CASCADE; - --- --- Name: refund FK_eec9d9af4ca098e19ea6b499eaa; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.refunds ADD CONSTRAINT "FK_eec9d9af4ca098e19ea6b499eaa" FOREIGN KEY (order_id) REFERENCES public.orders (id); - --- --- Name: discount_condition FK_efff700651718e452ca9580a624; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.discount_conditions ADD CONSTRAINT "FK_efff700651718e452ca9580a624" FOREIGN KEY (discount_rule_id) REFERENCES public.discount_rules (id); - --- --- Name: discount_condition_product FK_f05132301e95bdab4ba1cf29a24; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.discount_condition_products ADD CONSTRAINT "FK_f05132301e95bdab4ba1cf29a24" FOREIGN KEY (condition_id) REFERENCES public.discount_conditions (id) ON DELETE CASCADE; - --- --- Name: fulfillment FK_f129acc85e346a10eed12b86fca; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.fulfillments ADD CONSTRAINT "FK_f129acc85e346a10eed12b86fca" FOREIGN KEY (order_id) REFERENCES public.orders (id); - --- --- Name: money_amount FK_f249976b079375499662eb80c40; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.money_amounts ADD CONSTRAINT "FK_f249976b079375499662eb80c40" FOREIGN KEY (price_list_id) REFERENCES public.price_lists (id) ON DELETE CASCADE; - --- --- Name: order_gift_cards FK_f2bb9f71e95b315eb24b2b84cb3; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.order_gift_cards ADD CONSTRAINT "FK_f2bb9f71e95b315eb24b2b84cb3" FOREIGN KEY (gift_card_id) REFERENCES public.gift_cards (id) ON DELETE CASCADE; - --- --- Name: payment FK_f41553459a4b1491c9893ebc921; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.payments ADD CONSTRAINT "FK_f41553459a4b1491c9893ebc921" FOREIGN KEY (currency_code) REFERENCES public.currencies (code); - --- --- Name: discount_regions FK_f4194aa81073f3fab8aa86906ff; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.discount_regions ADD CONSTRAINT "FK_f4194aa81073f3fab8aa86906ff" FOREIGN KEY (discount_id) REFERENCES public.discounts (id) ON DELETE CASCADE; - --- --- Name: claim_order FK_f49e3974465d3c3a33d449d3f31; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.claim_orders ADD CONSTRAINT "FK_f49e3974465d3c3a33d449d3f31" FOREIGN KEY (order_id) REFERENCES public.orders (id); - --- --- Name: swap FK_f5189d38b3d3bd496618bf54c57; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.swaps ADD CONSTRAINT "FK_f5189d38b3d3bd496618bf54c57" FOREIGN KEY (shipping_address_id) REFERENCES public.addresses (id); - --- --- Name: payment FK_f5221735ace059250daac9d9803; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.payments ADD CONSTRAINT "FK_f5221735ace059250daac9d9803" FOREIGN KEY (order_id) REFERENCES public.orders (id); - --- --- Name: shipping_tax_rate FK_f672727ab020df6c50fb64c1a70; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.shipping_tax_rates ADD CONSTRAINT "FK_f672727ab020df6c50fb64c1a70" FOREIGN KEY (shipping_option_id) REFERENCES public.shipping_options (id) ON DELETE CASCADE; - --- --- Name: batch_job FK_fa53ca4f5fd90605b532802a626; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.batch_jobs ADD CONSTRAINT "FK_fa53ca4f5fd90605b532802a626" FOREIGN KEY (created_by) REFERENCES public.users (id); - --- --- Name: shipping_method FK_fb94fa8d5ca940daa2a58139f86; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.shipping_methods ADD CONSTRAINT "FK_fb94fa8d5ca940daa2a58139f86" FOREIGN KEY (swap_id) REFERENCES public.swaps (id); - --- --- Name: discount_condition_product_tag FK_fbb2499551ed074526f3ee36241; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.discount_condition_product_tags ADD CONSTRAINT "FK_fbb2499551ed074526f3ee36241" FOREIGN KEY (condition_id) REFERENCES public.discount_conditions (id) ON DELETE CASCADE; - --- --- Name: shipping_method FK_fc963e94854bff2714ca84cd193; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.shipping_methods ADD CONSTRAINT "FK_fc963e94854bff2714ca84cd193" FOREIGN KEY (shipping_option_id) REFERENCES public.shipping_options (id); - --- --- Name: order_edit FK_order_edit_payment_collection_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.order_edits ADD CONSTRAINT "FK_order_edit_payment_collection_id" FOREIGN KEY (payment_collection_id) REFERENCES public.payment_collections (id); - --- --- Name: payment_collection_payments FK_payment_collection_payments_payment_collection_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.payment_collection_payments ADD CONSTRAINT "FK_payment_collection_payments_payment_collection_id" FOREIGN KEY (payment_collection_id) REFERENCES public.payment_collections (id) ON DELETE CASCADE; - --- --- Name: payment_collection_payments FK_payment_collection_payments_payment_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.payment_collection_payments ADD CONSTRAINT "FK_payment_collection_payments_payment_id" FOREIGN KEY (payment_id) REFERENCES public.payments (id) ON DELETE CASCADE; - --- --- Name: payment_collection FK_payment_collection_region_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.payment_collections ADD CONSTRAINT "FK_payment_collection_region_id" FOREIGN KEY (region_id) REFERENCES public.regions (id); - --- --- Name: payment_collection_sessions FK_payment_collection_sessions_payment_collection_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.payment_collection_sessions ADD CONSTRAINT "FK_payment_collection_sessions_payment_collection_id" FOREIGN KEY (payment_collection_id) REFERENCES public.payment_collections (id) ON DELETE CASCADE; - --- --- Name: payment_collection_sessions FK_payment_collection_sessions_payment_session_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.payment_collection_sessions ADD CONSTRAINT "FK_payment_collection_sessions_payment_session_id" FOREIGN KEY (payment_session_id) REFERENCES public.payment_sessions (id) ON DELETE CASCADE; - --- --- Name: product_category_product FK_product_category_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.product_category_products ADD CONSTRAINT "FK_product_category_id" FOREIGN KEY (product_category_id) REFERENCES public.product_categories (id) ON DELETE CASCADE; - --- --- Name: product_category_product FK_product_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.product_category_products ADD CONSTRAINT "FK_product_id" FOREIGN KEY (product_id) REFERENCES public.products (id) ON DELETE CASCADE; - --- --- Name: refund FK_refund_payment_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.refunds ADD CONSTRAINT "FK_refund_payment_id" FOREIGN KEY (payment_id) REFERENCES public.payments (id); - --- --- Name: line_item line_item_order_edit_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.line_items ADD CONSTRAINT line_item_order_edit_fk FOREIGN KEY (order_edit_id) REFERENCES public.order_edits (id); - --- --- Name: line_item line_item_original_item_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - ALTER TABLE ONLY public.line_items ADD CONSTRAINT line_item_original_item_fk FOREIGN KEY (original_item_id) REFERENCES public.line_items (id);