Documentation
¶
Index ¶
- Variables
- func Create(ctx context.Context, s *Schema, tables []*schema.Table, ...) error
- func Diff(ctx context.Context, url string, opts ...schema.MigrateOption) error
- func NamedDiff(ctx context.Context, url, name string, opts ...schema.MigrateOption) error
- type Schema
- func (s *Schema) Create(ctx context.Context, opts ...schema.MigrateOption) error
- func (s *Schema) Diff(ctx context.Context, opts ...schema.MigrateOption) error
- func (s *Schema) NamedDiff(ctx context.Context, name string, opts ...schema.MigrateOption) error
- func (s *Schema) WriteTo(ctx context.Context, w io.Writer, opts ...schema.MigrateOption) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // WithGlobalUniqueID sets the universal ids options to the migration. // If this option is enabled, ent migration will allocate a 1<<32 range // for the ids of each entity (table). // Note that this option cannot be applied on tables that already exist. WithGlobalUniqueID = schema.WithGlobalUniqueID // WithDropColumn sets the drop column option to the migration. // If this option is enabled, ent migration will drop old columns // that were used for both fields and edges. This defaults to false. WithDropColumn = schema.WithDropColumn // WithDropIndex sets the drop index option to the migration. // If this option is enabled, ent migration will drop old indexes // that were defined in the schema. This defaults to false. // Note that unique constraints are defined using `UNIQUE INDEX`, // and therefore, it's recommended to enable this option to get more // flexibility in the schema changes. WithDropIndex = schema.WithDropIndex // WithForeignKeys enables creating foreign-key in schema DDL. This defaults to true. WithForeignKeys = schema.WithForeignKeys )
View Source
var ( // AddonsColumns holds the columns for the "addons" table. AddonsColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "namespace", Type: field.TypeString}, {Name: "metadata", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "name", Type: field.TypeString}, {Name: "description", Type: field.TypeString, Nullable: true}, {Name: "key", Type: field.TypeString}, {Name: "version", Type: field.TypeInt}, {Name: "currency", Type: field.TypeString, Default: "USD"}, {Name: "instance_type", Type: field.TypeEnum, Enums: []string{"single", "multiple"}, Default: "single"}, {Name: "effective_from", Type: field.TypeTime, Nullable: true}, {Name: "effective_to", Type: field.TypeTime, Nullable: true}, {Name: "annotations", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, } // AddonsTable holds the schema information for the "addons" table. AddonsTable = &schema.Table{ Name: "addons", Columns: AddonsColumns, PrimaryKey: []*schema.Column{AddonsColumns[0]}, Indexes: []*schema.Index{ { Name: "addon_id", Unique: true, Columns: []*schema.Column{AddonsColumns[0]}, }, { Name: "addon_namespace", Unique: false, Columns: []*schema.Column{AddonsColumns[1]}, }, { Name: "addon_namespace_id", Unique: true, Columns: []*schema.Column{AddonsColumns[1], AddonsColumns[0]}, }, { Name: "addon_namespace_key_deleted_at", Unique: true, Columns: []*schema.Column{AddonsColumns[1], AddonsColumns[8], AddonsColumns[5]}, }, { Name: "addon_namespace_key_version", Unique: true, Columns: []*schema.Column{AddonsColumns[1], AddonsColumns[8], AddonsColumns[9]}, Annotation: &entsql.IndexAnnotation{ Where: "deleted_at IS NULL", }, }, { Name: "addon_annotations", Unique: false, Columns: []*schema.Column{AddonsColumns[14]}, Annotation: &entsql.IndexAnnotation{ Types: map[string]string{ "postgres": "GIN", }, }, }, }, } // AddonRateCardsColumns holds the columns for the "addon_rate_cards" table. AddonRateCardsColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "namespace", Type: field.TypeString}, {Name: "metadata", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "name", Type: field.TypeString}, {Name: "description", Type: field.TypeString, Nullable: true}, {Name: "key", Type: field.TypeString}, {Name: "tax_behavior", Type: field.TypeEnum, Nullable: true, Enums: []string{"inclusive", "exclusive"}}, {Name: "type", Type: field.TypeEnum, Enums: []string{"flat_fee", "usage_based"}}, {Name: "feature_key", Type: field.TypeString, Nullable: true}, {Name: "entitlement_template", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "tax_config", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "billing_cadence", Type: field.TypeString, Nullable: true}, {Name: "price", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "discounts", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "addon_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "feature_id", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "tax_code_id", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, } // AddonRateCardsTable holds the schema information for the "addon_rate_cards" table. AddonRateCardsTable = &schema.Table{ Name: "addon_rate_cards", Columns: AddonRateCardsColumns, PrimaryKey: []*schema.Column{AddonRateCardsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "addon_rate_cards_addons_ratecards", Columns: []*schema.Column{AddonRateCardsColumns[17]}, RefColumns: []*schema.Column{AddonsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "addon_rate_cards_features_addon_ratecard", Columns: []*schema.Column{AddonRateCardsColumns[18]}, RefColumns: []*schema.Column{FeaturesColumns[0]}, OnDelete: schema.SetNull, }, { Symbol: "addon_rate_cards_tax_codes_addon_rate_cards", Columns: []*schema.Column{AddonRateCardsColumns[19]}, RefColumns: []*schema.Column{TaxCodesColumns[0]}, OnDelete: schema.SetNull, }, }, Indexes: []*schema.Index{ { Name: "addonratecard_id", Unique: true, Columns: []*schema.Column{AddonRateCardsColumns[0]}, }, { Name: "addonratecard_namespace", Unique: false, Columns: []*schema.Column{AddonRateCardsColumns[1]}, }, { Name: "addonratecard_namespace_id", Unique: true, Columns: []*schema.Column{AddonRateCardsColumns[1], AddonRateCardsColumns[0]}, }, { Name: "addonratecard_namespace_key_deleted_at", Unique: true, Columns: []*schema.Column{AddonRateCardsColumns[1], AddonRateCardsColumns[8], AddonRateCardsColumns[5]}, }, { Name: "addonratecard_tax_code_id", Unique: false, Columns: []*schema.Column{AddonRateCardsColumns[19]}, }, { Name: "addonratecard_addon_id_key", Unique: true, Columns: []*schema.Column{AddonRateCardsColumns[17], AddonRateCardsColumns[8]}, Annotation: &entsql.IndexAnnotation{ Where: "deleted_at IS NULL", }, }, { Name: "addonratecard_addon_id_feature_key", Unique: true, Columns: []*schema.Column{AddonRateCardsColumns[17], AddonRateCardsColumns[11]}, Annotation: &entsql.IndexAnnotation{ Where: "deleted_at IS NULL", }, }, }, } // AppsColumns holds the columns for the "apps" table. AppsColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "namespace", Type: field.TypeString}, {Name: "metadata", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "name", Type: field.TypeString}, {Name: "description", Type: field.TypeString, Nullable: true}, {Name: "type", Type: field.TypeString}, {Name: "status", Type: field.TypeString}, } // AppsTable holds the schema information for the "apps" table. AppsTable = &schema.Table{ Name: "apps", Columns: AppsColumns, PrimaryKey: []*schema.Column{AppsColumns[0]}, Indexes: []*schema.Index{ { Name: "app_id", Unique: true, Columns: []*schema.Column{AppsColumns[0]}, }, { Name: "app_namespace", Unique: false, Columns: []*schema.Column{AppsColumns[1]}, }, { Name: "app_namespace_id", Unique: true, Columns: []*schema.Column{AppsColumns[1], AppsColumns[0]}, }, { Name: "app_namespace_type", Unique: false, Columns: []*schema.Column{AppsColumns[1], AppsColumns[8]}, }, }, } // AppCustomInvoicingsColumns holds the columns for the "app_custom_invoicings" table. AppCustomInvoicingsColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "namespace", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "enable_draft_sync_hook", Type: field.TypeBool, Default: false}, {Name: "enable_issuing_sync_hook", Type: field.TypeBool, Default: false}, } // AppCustomInvoicingsTable holds the schema information for the "app_custom_invoicings" table. AppCustomInvoicingsTable = &schema.Table{ Name: "app_custom_invoicings", Columns: AppCustomInvoicingsColumns, PrimaryKey: []*schema.Column{AppCustomInvoicingsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "app_custom_invoicings_apps_app", Columns: []*schema.Column{AppCustomInvoicingsColumns[0]}, RefColumns: []*schema.Column{AppsColumns[0]}, OnDelete: schema.Cascade, }, }, Indexes: []*schema.Index{ { Name: "appcustominvoicing_id", Unique: true, Columns: []*schema.Column{AppCustomInvoicingsColumns[0]}, }, { Name: "appcustominvoicing_namespace", Unique: false, Columns: []*schema.Column{AppCustomInvoicingsColumns[1]}, }, { Name: "appcustominvoicing_namespace_id", Unique: true, Columns: []*schema.Column{AppCustomInvoicingsColumns[1], AppCustomInvoicingsColumns[0]}, }, }, } // AppCustomInvoicingCustomersColumns holds the columns for the "app_custom_invoicing_customers" table. AppCustomInvoicingCustomersColumns = []*schema.Column{ {Name: "id", Type: field.TypeInt, Increment: true}, {Name: "namespace", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "metadata", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "app_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "customer_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, } // AppCustomInvoicingCustomersTable holds the schema information for the "app_custom_invoicing_customers" table. AppCustomInvoicingCustomersTable = &schema.Table{ Name: "app_custom_invoicing_customers", Columns: AppCustomInvoicingCustomersColumns, PrimaryKey: []*schema.Column{AppCustomInvoicingCustomersColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "app_custom_invoicing_customers_app_custom_invoicings_customer_apps", Columns: []*schema.Column{AppCustomInvoicingCustomersColumns[6]}, RefColumns: []*schema.Column{AppCustomInvoicingsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "app_custom_invoicing_customers_customers_customer", Columns: []*schema.Column{AppCustomInvoicingCustomersColumns[7]}, RefColumns: []*schema.Column{CustomersColumns[0]}, OnDelete: schema.Cascade, }, }, Indexes: []*schema.Index{ { Name: "appcustominvoicingcustomer_namespace", Unique: false, Columns: []*schema.Column{AppCustomInvoicingCustomersColumns[1]}, }, { Name: "appcustominvoicingcustomer_namespace_app_id_customer_id", Unique: true, Columns: []*schema.Column{AppCustomInvoicingCustomersColumns[1], AppCustomInvoicingCustomersColumns[6], AppCustomInvoicingCustomersColumns[7]}, Annotation: &entsql.IndexAnnotation{ Where: "deleted_at IS NULL", }, }, }, } // AppCustomersColumns holds the columns for the "app_customers" table. AppCustomersColumns = []*schema.Column{ {Name: "id", Type: field.TypeInt, Increment: true}, {Name: "namespace", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "app_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "customer_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, } // AppCustomersTable holds the schema information for the "app_customers" table. AppCustomersTable = &schema.Table{ Name: "app_customers", Columns: AppCustomersColumns, PrimaryKey: []*schema.Column{AppCustomersColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "app_customers_apps_customer_apps", Columns: []*schema.Column{AppCustomersColumns[5]}, RefColumns: []*schema.Column{AppsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "app_customers_customers_apps", Columns: []*schema.Column{AppCustomersColumns[6]}, RefColumns: []*schema.Column{CustomersColumns[0]}, OnDelete: schema.Cascade, }, }, Indexes: []*schema.Index{ { Name: "appcustomer_namespace", Unique: false, Columns: []*schema.Column{AppCustomersColumns[1]}, }, { Name: "appcustomer_namespace_app_id_customer_id", Unique: true, Columns: []*schema.Column{AppCustomersColumns[1], AppCustomersColumns[5], AppCustomersColumns[6]}, Annotation: &entsql.IndexAnnotation{ Where: "deleted_at IS NULL", }, }, }, } // AppStripesColumns holds the columns for the "app_stripes" table. AppStripesColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "namespace", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "stripe_account_id", Type: field.TypeString}, {Name: "stripe_livemode", Type: field.TypeBool}, {Name: "api_key", Type: field.TypeString}, {Name: "masked_api_key", Type: field.TypeString}, {Name: "stripe_webhook_id", Type: field.TypeString}, {Name: "webhook_secret", Type: field.TypeString}, } // AppStripesTable holds the schema information for the "app_stripes" table. AppStripesTable = &schema.Table{ Name: "app_stripes", Columns: AppStripesColumns, PrimaryKey: []*schema.Column{AppStripesColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "app_stripes_apps_app", Columns: []*schema.Column{AppStripesColumns[0]}, RefColumns: []*schema.Column{AppsColumns[0]}, OnDelete: schema.Cascade, }, }, Indexes: []*schema.Index{ { Name: "appstripe_id", Unique: true, Columns: []*schema.Column{AppStripesColumns[0]}, }, { Name: "appstripe_namespace", Unique: false, Columns: []*schema.Column{AppStripesColumns[1]}, }, { Name: "appstripe_namespace_stripe_account_id_stripe_livemode", Unique: true, Columns: []*schema.Column{AppStripesColumns[1], AppStripesColumns[5], AppStripesColumns[6]}, Annotation: &entsql.IndexAnnotation{ Where: "deleted_at IS NULL", }, }, }, } // AppStripeCustomersColumns holds the columns for the "app_stripe_customers" table. AppStripeCustomersColumns = []*schema.Column{ {Name: "id", Type: field.TypeInt, Increment: true}, {Name: "namespace", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "stripe_customer_id", Type: field.TypeString}, {Name: "stripe_default_payment_method_id", Type: field.TypeString, Nullable: true}, {Name: "app_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "customer_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, } // AppStripeCustomersTable holds the schema information for the "app_stripe_customers" table. AppStripeCustomersTable = &schema.Table{ Name: "app_stripe_customers", Columns: AppStripeCustomersColumns, PrimaryKey: []*schema.Column{AppStripeCustomersColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "app_stripe_customers_app_stripes_customer_apps", Columns: []*schema.Column{AppStripeCustomersColumns[7]}, RefColumns: []*schema.Column{AppStripesColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "app_stripe_customers_customers_customer", Columns: []*schema.Column{AppStripeCustomersColumns[8]}, RefColumns: []*schema.Column{CustomersColumns[0]}, OnDelete: schema.Cascade, }, }, Indexes: []*schema.Index{ { Name: "appstripecustomer_namespace", Unique: false, Columns: []*schema.Column{AppStripeCustomersColumns[1]}, }, { Name: "appstripecustomer_namespace_app_id_customer_id", Unique: true, Columns: []*schema.Column{AppStripeCustomersColumns[1], AppStripeCustomersColumns[7], AppStripeCustomersColumns[8]}, Annotation: &entsql.IndexAnnotation{ Where: "deleted_at IS NULL", }, }, { Name: "appstripecustomer_app_id_stripe_customer_id", Unique: true, Columns: []*schema.Column{AppStripeCustomersColumns[7], AppStripeCustomersColumns[5]}, Annotation: &entsql.IndexAnnotation{ Where: "deleted_at IS NULL", }, }, }, } // BalanceSnapshotsColumns holds the columns for the "balance_snapshots" table. BalanceSnapshotsColumns = []*schema.Column{ {Name: "id", Type: field.TypeInt, Increment: true}, {Name: "namespace", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "grant_balances", Type: field.TypeJSON, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "usage", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "balance", Type: field.TypeFloat64, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "overage", Type: field.TypeFloat64, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "at", Type: field.TypeTime}, {Name: "owner_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, } // BalanceSnapshotsTable holds the schema information for the "balance_snapshots" table. BalanceSnapshotsTable = &schema.Table{ Name: "balance_snapshots", Columns: BalanceSnapshotsColumns, PrimaryKey: []*schema.Column{BalanceSnapshotsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "balance_snapshots_entitlements_balance_snapshot", Columns: []*schema.Column{BalanceSnapshotsColumns[10]}, RefColumns: []*schema.Column{EntitlementsColumns[0]}, OnDelete: schema.Cascade, }, }, Indexes: []*schema.Index{ { Name: "balancesnapshot_namespace", Unique: false, Columns: []*schema.Column{BalanceSnapshotsColumns[1]}, }, { Name: "balancesnapshot_namespace_owner_id_at", Unique: false, Columns: []*schema.Column{BalanceSnapshotsColumns[1], BalanceSnapshotsColumns[10], BalanceSnapshotsColumns[9]}, Annotation: &entsql.IndexAnnotation{ Where: "deleted_at IS NULL", }, }, }, } // BillingCustomerLocksColumns holds the columns for the "billing_customer_locks" table. BillingCustomerLocksColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "namespace", Type: field.TypeString}, {Name: "customer_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, } // BillingCustomerLocksTable holds the schema information for the "billing_customer_locks" table. BillingCustomerLocksTable = &schema.Table{ Name: "billing_customer_locks", Columns: BillingCustomerLocksColumns, PrimaryKey: []*schema.Column{BillingCustomerLocksColumns[0]}, Indexes: []*schema.Index{ { Name: "billingcustomerlock_namespace", Unique: false, Columns: []*schema.Column{BillingCustomerLocksColumns[1]}, }, { Name: "billingcustomerlock_id", Unique: true, Columns: []*schema.Column{BillingCustomerLocksColumns[0]}, }, { Name: "billingcustomerlock_namespace_customer_id", Unique: true, Columns: []*schema.Column{BillingCustomerLocksColumns[1], BillingCustomerLocksColumns[2]}, }, }, } // BillingCustomerOverridesColumns holds the columns for the "billing_customer_overrides" table. BillingCustomerOverridesColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "namespace", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "tax_behavior", Type: field.TypeEnum, Nullable: true, Enums: []string{"inclusive", "exclusive"}}, {Name: "collection_alignment", Type: field.TypeEnum, Nullable: true, Enums: []string{"subscription", "anchored"}}, {Name: "anchored_alignment_detail", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "line_collection_period", Type: field.TypeString, Nullable: true}, {Name: "invoice_auto_advance", Type: field.TypeBool, Nullable: true}, {Name: "invoice_draft_period", Type: field.TypeString, Nullable: true}, {Name: "invoice_due_after", Type: field.TypeString, Nullable: true}, {Name: "invoice_collection_method", Type: field.TypeEnum, Nullable: true, Enums: []string{"charge_automatically", "send_invoice"}}, {Name: "invoice_progressive_billing", Type: field.TypeBool, Nullable: true}, {Name: "invoice_default_tax_config", Type: field.TypeJSON, Nullable: true}, {Name: "billing_profile_id", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "customer_id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "tax_code_id", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, } // BillingCustomerOverridesTable holds the schema information for the "billing_customer_overrides" table. BillingCustomerOverridesTable = &schema.Table{ Name: "billing_customer_overrides", Columns: BillingCustomerOverridesColumns, PrimaryKey: []*schema.Column{BillingCustomerOverridesColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "billing_customer_overrides_billing_profiles_billing_customer_override", Columns: []*schema.Column{BillingCustomerOverridesColumns[15]}, RefColumns: []*schema.Column{BillingProfilesColumns[0]}, OnDelete: schema.SetNull, }, { Symbol: "billing_customer_overrides_customers_billing_customer_override", Columns: []*schema.Column{BillingCustomerOverridesColumns[16]}, RefColumns: []*schema.Column{CustomersColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "billing_customer_overrides_tax_codes_billing_customer_overrides", Columns: []*schema.Column{BillingCustomerOverridesColumns[17]}, RefColumns: []*schema.Column{TaxCodesColumns[0]}, OnDelete: schema.SetNull, }, }, Indexes: []*schema.Index{ { Name: "billingcustomeroverride_id", Unique: true, Columns: []*schema.Column{BillingCustomerOverridesColumns[0]}, }, { Name: "billingcustomeroverride_namespace", Unique: false, Columns: []*schema.Column{BillingCustomerOverridesColumns[1]}, }, { Name: "billingcustomeroverride_tax_code_id", Unique: false, Columns: []*schema.Column{BillingCustomerOverridesColumns[17]}, }, { Name: "billingcustomeroverride_namespace_id", Unique: true, Columns: []*schema.Column{BillingCustomerOverridesColumns[1], BillingCustomerOverridesColumns[0]}, }, { Name: "billingcustomeroverride_namespace_customer_id", Unique: true, Columns: []*schema.Column{BillingCustomerOverridesColumns[1], BillingCustomerOverridesColumns[16]}, }, }, } // BillingInvoicesColumns holds the columns for the "billing_invoices" table. BillingInvoicesColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "namespace", Type: field.TypeString}, {Name: "metadata", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "supplier_address_country", Type: field.TypeString, Nullable: true, Size: 2}, {Name: "supplier_address_postal_code", Type: field.TypeString, Nullable: true}, {Name: "supplier_address_state", Type: field.TypeString, Nullable: true}, {Name: "supplier_address_city", Type: field.TypeString, Nullable: true}, {Name: "supplier_address_line1", Type: field.TypeString, Nullable: true}, {Name: "supplier_address_line2", Type: field.TypeString, Nullable: true}, {Name: "supplier_address_phone_number", Type: field.TypeString, Nullable: true}, {Name: "customer_address_country", Type: field.TypeString, Nullable: true, Size: 2}, {Name: "customer_address_postal_code", Type: field.TypeString, Nullable: true}, {Name: "customer_address_state", Type: field.TypeString, Nullable: true}, {Name: "customer_address_city", Type: field.TypeString, Nullable: true}, {Name: "customer_address_line1", Type: field.TypeString, Nullable: true}, {Name: "customer_address_line2", Type: field.TypeString, Nullable: true}, {Name: "customer_address_phone_number", Type: field.TypeString, Nullable: true}, {Name: "amount", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "taxes_total", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "taxes_inclusive_total", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "taxes_exclusive_total", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "charges_total", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "discounts_total", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "credits_total", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "total", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "invoicing_app_external_id", Type: field.TypeString, Nullable: true}, {Name: "payment_app_external_id", Type: field.TypeString, Nullable: true}, {Name: "tax_app_external_id", Type: field.TypeString, Nullable: true}, {Name: "supplier_name", Type: field.TypeString}, {Name: "supplier_tax_code", Type: field.TypeString, Nullable: true}, {Name: "customer_key", Type: field.TypeString, Nullable: true}, {Name: "customer_name", Type: field.TypeString}, {Name: "customer_usage_attribution", Type: field.TypeJSON, Nullable: true}, {Name: "number", Type: field.TypeString}, {Name: "type", Type: field.TypeEnum, Enums: []string{"standard", "gathering"}}, {Name: "description", Type: field.TypeString, Nullable: true}, {Name: "voided_at", Type: field.TypeTime, Nullable: true}, {Name: "issued_at", Type: field.TypeTime, Nullable: true}, {Name: "sent_to_customer_at", Type: field.TypeTime, Nullable: true}, {Name: "draft_until", Type: field.TypeTime, Nullable: true}, {Name: "quantity_snapshoted_at", Type: field.TypeTime, Nullable: true}, {Name: "currency", Type: field.TypeString, SchemaType: map[string]string{"postgres": "varchar(3)"}}, {Name: "due_at", Type: field.TypeTime, Nullable: true}, {Name: "status", Type: field.TypeEnum, Enums: []string{"gathering", "draft.created", "draft.waiting_for_collection", "draft.collecting", "draft.updating", "draft.manual_approval_needed", "draft.validating", "draft.invalid", "draft.syncing", "draft.sync_failed", "draft.waiting_auto_approval", "draft.ready_to_issue", "delete.in_progress", "delete.syncing", "delete.failed", "deleted", "issuing.syncing", "issuing.failed", "issuing.charge_booking", "issuing.charge_booking_failed", "issued", "payment_processing.pending", "payment_processing.booking_authorized", "payment_processing.booking_authorized_failed", "payment_processing.booking_authorized_and_settled", "payment_processing.booking_authorized_and_settled_failed", "payment_processing.authorized", "payment_processing.failed", "payment_processing.action_required", "payment_processing.booking_settled", "payment_processing.booking_settled_failed", "overdue", "paid", "uncollectible", "voided"}}, {Name: "status_details_cache", Type: field.TypeJSON, Nullable: true}, {Name: "period_start", Type: field.TypeTime, Nullable: true}, {Name: "period_end", Type: field.TypeTime, Nullable: true}, {Name: "collection_at", Type: field.TypeTime, Nullable: true}, {Name: "payment_processing_entered_at", Type: field.TypeTime, Nullable: true}, {Name: "schema_level", Type: field.TypeInt, Default: 1}, {Name: "tax_app_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "invoicing_app_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "payment_app_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "source_billing_profile_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "workflow_config_id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "customer_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, } // BillingInvoicesTable holds the schema information for the "billing_invoices" table. BillingInvoicesTable = &schema.Table{ Name: "billing_invoices", Columns: BillingInvoicesColumns, PrimaryKey: []*schema.Column{BillingInvoicesColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "billing_invoices_apps_billing_invoice_tax_app", Columns: []*schema.Column{BillingInvoicesColumns[53]}, RefColumns: []*schema.Column{AppsColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "billing_invoices_apps_billing_invoice_invoicing_app", Columns: []*schema.Column{BillingInvoicesColumns[54]}, RefColumns: []*schema.Column{AppsColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "billing_invoices_apps_billing_invoice_payment_app", Columns: []*schema.Column{BillingInvoicesColumns[55]}, RefColumns: []*schema.Column{AppsColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "billing_invoices_billing_profiles_billing_invoices", Columns: []*schema.Column{BillingInvoicesColumns[56]}, RefColumns: []*schema.Column{BillingProfilesColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "billing_invoices_billing_workflow_configs_billing_invoices", Columns: []*schema.Column{BillingInvoicesColumns[57]}, RefColumns: []*schema.Column{BillingWorkflowConfigsColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "billing_invoices_customers_billing_invoice", Columns: []*schema.Column{BillingInvoicesColumns[58]}, RefColumns: []*schema.Column{CustomersColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "billinginvoice_id", Unique: true, Columns: []*schema.Column{BillingInvoicesColumns[0]}, }, { Name: "billinginvoice_namespace", Unique: false, Columns: []*schema.Column{BillingInvoicesColumns[1]}, }, { Name: "billinginvoice_namespace_id", Unique: false, Columns: []*schema.Column{BillingInvoicesColumns[1], BillingInvoicesColumns[0]}, }, { Name: "billinginvoice_namespace_customer_id", Unique: false, Columns: []*schema.Column{BillingInvoicesColumns[1], BillingInvoicesColumns[58]}, }, { Name: "billinginvoice_namespace_status", Unique: false, Columns: []*schema.Column{BillingInvoicesColumns[1], BillingInvoicesColumns[46]}, }, { Name: "billinginvoice_namespace_period_start", Unique: false, Columns: []*schema.Column{BillingInvoicesColumns[1], BillingInvoicesColumns[48]}, }, { Name: "billinginvoice_namespace_created_at", Unique: false, Columns: []*schema.Column{BillingInvoicesColumns[1], BillingInvoicesColumns[3]}, }, { Name: "billinginvoice_namespace_updated_at", Unique: false, Columns: []*schema.Column{BillingInvoicesColumns[1], BillingInvoicesColumns[4]}, }, { Name: "billinginvoice_namespace_issued_at", Unique: false, Columns: []*schema.Column{BillingInvoicesColumns[1], BillingInvoicesColumns[40]}, }, { Name: "billinginvoice_status_details_cache", Unique: false, Columns: []*schema.Column{BillingInvoicesColumns[47]}, Annotation: &entsql.IndexAnnotation{ Types: map[string]string{ "postgres": "GIN", }, }, }, { Name: "billinginvoice_namespace_customer_id_currency", Unique: true, Columns: []*schema.Column{BillingInvoicesColumns[1], BillingInvoicesColumns[58], BillingInvoicesColumns[44]}, Annotation: &entsql.IndexAnnotation{ Where: "deleted_at IS NULL and status = 'gathering'", }, }, }, } // BillingInvoiceFlatFeeLineConfigsColumns holds the columns for the "billing_invoice_flat_fee_line_configs" table. BillingInvoiceFlatFeeLineConfigsColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "namespace", Type: field.TypeString}, {Name: "per_unit_amount", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "category", Type: field.TypeEnum, Enums: []string{"regular", "commitment"}, Default: "regular"}, {Name: "payment_term", Type: field.TypeEnum, Enums: []string{"in_advance", "in_arrears"}, Default: "in_advance"}, {Name: "index", Type: field.TypeInt, Nullable: true}, } // BillingInvoiceFlatFeeLineConfigsTable holds the schema information for the "billing_invoice_flat_fee_line_configs" table. BillingInvoiceFlatFeeLineConfigsTable = &schema.Table{ Name: "billing_invoice_flat_fee_line_configs", Columns: BillingInvoiceFlatFeeLineConfigsColumns, PrimaryKey: []*schema.Column{BillingInvoiceFlatFeeLineConfigsColumns[0]}, Indexes: []*schema.Index{ { Name: "billinginvoiceflatfeelineconfig_namespace", Unique: false, Columns: []*schema.Column{BillingInvoiceFlatFeeLineConfigsColumns[1]}, }, { Name: "billinginvoiceflatfeelineconfig_id", Unique: true, Columns: []*schema.Column{BillingInvoiceFlatFeeLineConfigsColumns[0]}, }, }, } // BillingInvoiceLinesColumns holds the columns for the "billing_invoice_lines" table. BillingInvoiceLinesColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "annotations", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "namespace", Type: field.TypeString}, {Name: "metadata", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "name", Type: field.TypeString}, {Name: "description", Type: field.TypeString, Nullable: true}, {Name: "currency", Type: field.TypeString, SchemaType: map[string]string{"postgres": "varchar(3)"}}, {Name: "tax_config", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "tax_behavior", Type: field.TypeEnum, Nullable: true, Enums: []string{"inclusive", "exclusive"}}, {Name: "amount", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "taxes_total", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "taxes_inclusive_total", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "taxes_exclusive_total", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "charges_total", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "discounts_total", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "credits_total", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "total", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "invoicing_app_external_id", Type: field.TypeString, Nullable: true}, {Name: "period_start", Type: field.TypeTime}, {Name: "period_end", Type: field.TypeTime}, {Name: "managed_by", Type: field.TypeEnum, Enums: []string{"subscription", "system", "manual"}}, {Name: "invoice_at", Type: field.TypeTime}, {Name: "override_collection_period_end", Type: field.TypeTime, Nullable: true}, {Name: "type", Type: field.TypeEnum, Enums: []string{"flat_fee", "usage_based"}}, {Name: "status", Type: field.TypeEnum, Enums: []string{"valid", "detailed"}}, {Name: "quantity", Type: field.TypeOther, Nullable: true, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "ratecard_discounts", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "child_unique_reference_id", Type: field.TypeString, Nullable: true}, {Name: "subscription_billing_period_from", Type: field.TypeTime, Nullable: true}, {Name: "subscription_billing_period_to", Type: field.TypeTime, Nullable: true}, {Name: "engine", Type: field.TypeEnum, Enums: []string{"invoicing", "charge_flatfee", "charge_usagebased", "charge_creditpurchase"}, Default: "invoicing"}, {Name: "line_ids", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "credits_applied", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "invoice_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "fee_line_config_id", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "usage_based_line_config_id", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "parent_line_id", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "split_line_group_id", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "charge_id", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "subscription_id", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "subscription_item_id", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "subscription_phase_id", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "tax_code_id", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, } // BillingInvoiceLinesTable holds the schema information for the "billing_invoice_lines" table. BillingInvoiceLinesTable = &schema.Table{ Name: "billing_invoice_lines", Columns: BillingInvoiceLinesColumns, PrimaryKey: []*schema.Column{BillingInvoiceLinesColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "billing_invoice_lines_billing_invoices_billing_invoice_lines", Columns: []*schema.Column{BillingInvoiceLinesColumns[36]}, RefColumns: []*schema.Column{BillingInvoicesColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "billing_invoice_lines_billing_invoice_flat_fee_line_configs_flat_fee_line", Columns: []*schema.Column{BillingInvoiceLinesColumns[37]}, RefColumns: []*schema.Column{BillingInvoiceFlatFeeLineConfigsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "billing_invoice_lines_billing_invoice_usage_based_line_configs_usage_based_line", Columns: []*schema.Column{BillingInvoiceLinesColumns[38]}, RefColumns: []*schema.Column{BillingInvoiceUsageBasedLineConfigsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "billing_invoice_lines_billing_invoice_lines_detailed_lines", Columns: []*schema.Column{BillingInvoiceLinesColumns[39]}, RefColumns: []*schema.Column{BillingInvoiceLinesColumns[0]}, OnDelete: schema.SetNull, }, { Symbol: "billing_invoice_lines_billing_invoice_split_line_groups_billing_invoice_lines", Columns: []*schema.Column{BillingInvoiceLinesColumns[40]}, RefColumns: []*schema.Column{BillingInvoiceSplitLineGroupsColumns[0]}, OnDelete: schema.SetNull, }, { Symbol: "billing_invoice_lines_charges_billing_invoice_lines", Columns: []*schema.Column{BillingInvoiceLinesColumns[41]}, RefColumns: []*schema.Column{ChargesColumns[0]}, OnDelete: schema.SetNull, }, { Symbol: "billing_invoice_lines_subscriptions_billing_lines", Columns: []*schema.Column{BillingInvoiceLinesColumns[42]}, RefColumns: []*schema.Column{SubscriptionsColumns[0]}, OnDelete: schema.SetNull, }, { Symbol: "billing_invoice_lines_subscription_items_billing_lines", Columns: []*schema.Column{BillingInvoiceLinesColumns[43]}, RefColumns: []*schema.Column{SubscriptionItemsColumns[0]}, OnDelete: schema.SetNull, }, { Symbol: "billing_invoice_lines_subscription_phases_billing_lines", Columns: []*schema.Column{BillingInvoiceLinesColumns[44]}, RefColumns: []*schema.Column{SubscriptionPhasesColumns[0]}, OnDelete: schema.SetNull, }, { Symbol: "billing_invoice_lines_tax_codes_billing_invoice_lines", Columns: []*schema.Column{BillingInvoiceLinesColumns[45]}, RefColumns: []*schema.Column{TaxCodesColumns[0]}, OnDelete: schema.SetNull, }, }, Indexes: []*schema.Index{ { Name: "billinginvoiceline_annotations", Unique: false, Columns: []*schema.Column{BillingInvoiceLinesColumns[1]}, Annotation: &entsql.IndexAnnotation{ Types: map[string]string{ "postgres": "GIN", }, }, }, { Name: "billinginvoiceline_id", Unique: true, Columns: []*schema.Column{BillingInvoiceLinesColumns[0]}, }, { Name: "billinginvoiceline_namespace", Unique: false, Columns: []*schema.Column{BillingInvoiceLinesColumns[2]}, }, { Name: "billinginvoiceline_namespace_id", Unique: true, Columns: []*schema.Column{BillingInvoiceLinesColumns[2], BillingInvoiceLinesColumns[0]}, }, { Name: "billinginvoiceline_tax_code_id", Unique: false, Columns: []*schema.Column{BillingInvoiceLinesColumns[45]}, }, { Name: "billinginvoiceline_namespace_invoice_id", Unique: false, Columns: []*schema.Column{BillingInvoiceLinesColumns[2], BillingInvoiceLinesColumns[36]}, }, { Name: "billinginvoiceline_namespace_parent_line_id", Unique: false, Columns: []*schema.Column{BillingInvoiceLinesColumns[2], BillingInvoiceLinesColumns[39]}, }, { Name: "billinginvoiceline_namespace_parent_line_id_child_unique_reference_id", Unique: true, Columns: []*schema.Column{BillingInvoiceLinesColumns[2], BillingInvoiceLinesColumns[39], BillingInvoiceLinesColumns[30]}, Annotation: &entsql.IndexAnnotation{ Where: "child_unique_reference_id IS NOT NULL AND deleted_at IS NULL", }, }, { Name: "billinginvoiceline_namespace_subscription_id_subscription_phase_id_subscription_item_id", Unique: false, Columns: []*schema.Column{BillingInvoiceLinesColumns[2], BillingInvoiceLinesColumns[42], BillingInvoiceLinesColumns[44], BillingInvoiceLinesColumns[43]}, }, }, } // BillingInvoiceLineDiscountsColumns holds the columns for the "billing_invoice_line_discounts" table. BillingInvoiceLineDiscountsColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "namespace", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "invoicing_app_external_id", Type: field.TypeString, Nullable: true}, {Name: "child_unique_reference_id", Type: field.TypeString, Nullable: true}, {Name: "description", Type: field.TypeString, Nullable: true}, {Name: "reason", Type: field.TypeEnum, Enums: []string{"maximum_spend", "ratecard_percentage", "ratecard_usage"}}, {Name: "amount", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "rounding_amount", Type: field.TypeOther, Nullable: true, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "source_discount", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "type", Type: field.TypeString, Nullable: true}, {Name: "quantity", Type: field.TypeOther, Nullable: true, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "pre_line_period_quantity", Type: field.TypeOther, Nullable: true, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "line_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, } // BillingInvoiceLineDiscountsTable holds the schema information for the "billing_invoice_line_discounts" table. BillingInvoiceLineDiscountsTable = &schema.Table{ Name: "billing_invoice_line_discounts", Columns: BillingInvoiceLineDiscountsColumns, PrimaryKey: []*schema.Column{BillingInvoiceLineDiscountsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "billing_invoice_line_discounts_billing_invoice_lines_line_amount_discounts", Columns: []*schema.Column{BillingInvoiceLineDiscountsColumns[15]}, RefColumns: []*schema.Column{BillingInvoiceLinesColumns[0]}, OnDelete: schema.Cascade, }, }, Indexes: []*schema.Index{ { Name: "billinginvoicelinediscount_id", Unique: true, Columns: []*schema.Column{BillingInvoiceLineDiscountsColumns[0]}, }, { Name: "billinginvoicelinediscount_namespace", Unique: false, Columns: []*schema.Column{BillingInvoiceLineDiscountsColumns[1]}, }, { Name: "billinginvoicelinediscount_namespace_line_id", Unique: false, Columns: []*schema.Column{BillingInvoiceLineDiscountsColumns[1], BillingInvoiceLineDiscountsColumns[15]}, }, { Name: "billinginvoicelinediscount_namespace_line_id_child_unique_reference_id", Unique: true, Columns: []*schema.Column{BillingInvoiceLineDiscountsColumns[1], BillingInvoiceLineDiscountsColumns[15], BillingInvoiceLineDiscountsColumns[6]}, Annotation: &entsql.IndexAnnotation{ Where: "child_unique_reference_id IS NOT NULL AND deleted_at IS NULL", }, }, }, } // BillingInvoiceLineUsageDiscountsColumns holds the columns for the "billing_invoice_line_usage_discounts" table. BillingInvoiceLineUsageDiscountsColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "namespace", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "invoicing_app_external_id", Type: field.TypeString, Nullable: true}, {Name: "child_unique_reference_id", Type: field.TypeString, Nullable: true}, {Name: "description", Type: field.TypeString, Nullable: true}, {Name: "reason", Type: field.TypeEnum, Enums: []string{"maximum_spend", "ratecard_percentage", "ratecard_usage"}}, {Name: "quantity", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "pre_line_period_quantity", Type: field.TypeOther, Nullable: true, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "reason_details", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "line_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, } // BillingInvoiceLineUsageDiscountsTable holds the schema information for the "billing_invoice_line_usage_discounts" table. BillingInvoiceLineUsageDiscountsTable = &schema.Table{ Name: "billing_invoice_line_usage_discounts", Columns: BillingInvoiceLineUsageDiscountsColumns, PrimaryKey: []*schema.Column{BillingInvoiceLineUsageDiscountsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "billing_invoice_line_usage_discounts_billing_invoice_lines_line_usage_discounts", Columns: []*schema.Column{BillingInvoiceLineUsageDiscountsColumns[12]}, RefColumns: []*schema.Column{BillingInvoiceLinesColumns[0]}, OnDelete: schema.Cascade, }, }, Indexes: []*schema.Index{ { Name: "billinginvoicelineusagediscount_id", Unique: true, Columns: []*schema.Column{BillingInvoiceLineUsageDiscountsColumns[0]}, }, { Name: "billinginvoicelineusagediscount_namespace", Unique: false, Columns: []*schema.Column{BillingInvoiceLineUsageDiscountsColumns[1]}, }, { Name: "billinginvoicelineusagediscount_namespace_line_id", Unique: false, Columns: []*schema.Column{BillingInvoiceLineUsageDiscountsColumns[1], BillingInvoiceLineUsageDiscountsColumns[12]}, }, { Name: "billinginvoicelineusagediscount_namespace_line_id_child_unique_reference_id", Unique: true, Columns: []*schema.Column{BillingInvoiceLineUsageDiscountsColumns[1], BillingInvoiceLineUsageDiscountsColumns[12], BillingInvoiceLineUsageDiscountsColumns[6]}, Annotation: &entsql.IndexAnnotation{ Where: "child_unique_reference_id IS NOT NULL AND deleted_at IS NULL", }, }, }, } // BillingInvoiceSplitLineGroupsColumns holds the columns for the "billing_invoice_split_line_groups" table. BillingInvoiceSplitLineGroupsColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "namespace", Type: field.TypeString}, {Name: "metadata", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "name", Type: field.TypeString}, {Name: "description", Type: field.TypeString, Nullable: true}, {Name: "currency", Type: field.TypeString, SchemaType: map[string]string{"postgres": "varchar(3)"}}, {Name: "tax_config", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "tax_behavior", Type: field.TypeEnum, Nullable: true, Enums: []string{"inclusive", "exclusive"}}, {Name: "service_period_start", Type: field.TypeTime}, {Name: "service_period_end", Type: field.TypeTime}, {Name: "unique_reference_id", Type: field.TypeString, Nullable: true}, {Name: "ratecard_discounts", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "feature_key", Type: field.TypeString, Nullable: true}, {Name: "price", Type: field.TypeString, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "subscription_billing_period_from", Type: field.TypeTime, Nullable: true}, {Name: "subscription_billing_period_to", Type: field.TypeTime, Nullable: true}, {Name: "charge_id", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "subscription_id", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "subscription_item_id", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "subscription_phase_id", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "tax_code_id", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, } // BillingInvoiceSplitLineGroupsTable holds the schema information for the "billing_invoice_split_line_groups" table. BillingInvoiceSplitLineGroupsTable = &schema.Table{ Name: "billing_invoice_split_line_groups", Columns: BillingInvoiceSplitLineGroupsColumns, PrimaryKey: []*schema.Column{BillingInvoiceSplitLineGroupsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "billing_invoice_split_line_groups_charges_billing_split_line_groups", Columns: []*schema.Column{BillingInvoiceSplitLineGroupsColumns[19]}, RefColumns: []*schema.Column{ChargesColumns[0]}, OnDelete: schema.SetNull, }, { Symbol: "billing_invoice_split_line_groups_subscriptions_billing_split_line_groups", Columns: []*schema.Column{BillingInvoiceSplitLineGroupsColumns[20]}, RefColumns: []*schema.Column{SubscriptionsColumns[0]}, OnDelete: schema.SetNull, }, { Symbol: "billing_invoice_split_line_groups_subscription_items_billing_split_line_groups", Columns: []*schema.Column{BillingInvoiceSplitLineGroupsColumns[21]}, RefColumns: []*schema.Column{SubscriptionItemsColumns[0]}, OnDelete: schema.SetNull, }, { Symbol: "billing_invoice_split_line_groups_subscription_phases_billing_split_line_groups", Columns: []*schema.Column{BillingInvoiceSplitLineGroupsColumns[22]}, RefColumns: []*schema.Column{SubscriptionPhasesColumns[0]}, OnDelete: schema.SetNull, }, { Symbol: "billing_invoice_split_line_groups_tax_codes_billing_invoice_split_line_groups", Columns: []*schema.Column{BillingInvoiceSplitLineGroupsColumns[23]}, RefColumns: []*schema.Column{TaxCodesColumns[0]}, OnDelete: schema.SetNull, }, }, Indexes: []*schema.Index{ { Name: "billinginvoicesplitlinegroup_id", Unique: true, Columns: []*schema.Column{BillingInvoiceSplitLineGroupsColumns[0]}, }, { Name: "billinginvoicesplitlinegroup_namespace", Unique: false, Columns: []*schema.Column{BillingInvoiceSplitLineGroupsColumns[1]}, }, { Name: "billinginvoicesplitlinegroup_namespace_id", Unique: true, Columns: []*schema.Column{BillingInvoiceSplitLineGroupsColumns[1], BillingInvoiceSplitLineGroupsColumns[0]}, }, { Name: "billinginvoicesplitlinegroup_tax_code_id", Unique: false, Columns: []*schema.Column{BillingInvoiceSplitLineGroupsColumns[23]}, }, { Name: "billinginvoicesplitlinegroup_namespace_unique_reference_id", Unique: true, Columns: []*schema.Column{BillingInvoiceSplitLineGroupsColumns[1], BillingInvoiceSplitLineGroupsColumns[13]}, Annotation: &entsql.IndexAnnotation{ Where: "unique_reference_id IS NOT NULL AND deleted_at IS NULL", }, }, }, } // BillingInvoiceUsageBasedLineConfigsColumns holds the columns for the "billing_invoice_usage_based_line_configs" table. BillingInvoiceUsageBasedLineConfigsColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "namespace", Type: field.TypeString}, {Name: "price_type", Type: field.TypeEnum, Enums: []string{"flat", "unit", "tiered", "dynamic", "package"}}, {Name: "feature_key", Type: field.TypeString, Nullable: true}, {Name: "price", Type: field.TypeString, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "pre_line_period_quantity", Type: field.TypeOther, Nullable: true, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "metered_pre_line_period_quantity", Type: field.TypeOther, Nullable: true, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "metered_quantity", Type: field.TypeOther, Nullable: true, SchemaType: map[string]string{"postgres": "numeric"}}, } // BillingInvoiceUsageBasedLineConfigsTable holds the schema information for the "billing_invoice_usage_based_line_configs" table. BillingInvoiceUsageBasedLineConfigsTable = &schema.Table{ Name: "billing_invoice_usage_based_line_configs", Columns: BillingInvoiceUsageBasedLineConfigsColumns, PrimaryKey: []*schema.Column{BillingInvoiceUsageBasedLineConfigsColumns[0]}, Indexes: []*schema.Index{ { Name: "billinginvoiceusagebasedlineconfig_namespace", Unique: false, Columns: []*schema.Column{BillingInvoiceUsageBasedLineConfigsColumns[1]}, }, { Name: "billinginvoiceusagebasedlineconfig_id", Unique: true, Columns: []*schema.Column{BillingInvoiceUsageBasedLineConfigsColumns[0]}, }, }, } // BillingInvoiceValidationIssuesColumns holds the columns for the "billing_invoice_validation_issues" table. BillingInvoiceValidationIssuesColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "namespace", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "severity", Type: field.TypeEnum, Enums: []string{"critical", "warning"}}, {Name: "code", Type: field.TypeString, Nullable: true}, {Name: "message", Type: field.TypeString}, {Name: "path", Type: field.TypeString, Nullable: true}, {Name: "component", Type: field.TypeString}, {Name: "dedupe_hash", Type: field.TypeBytes, Size: 32}, {Name: "invoice_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, } // BillingInvoiceValidationIssuesTable holds the schema information for the "billing_invoice_validation_issues" table. BillingInvoiceValidationIssuesTable = &schema.Table{ Name: "billing_invoice_validation_issues", Columns: BillingInvoiceValidationIssuesColumns, PrimaryKey: []*schema.Column{BillingInvoiceValidationIssuesColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "billing_invoice_validation_issues_billing_invoices_billing_invoice_validation_issues", Columns: []*schema.Column{BillingInvoiceValidationIssuesColumns[11]}, RefColumns: []*schema.Column{BillingInvoicesColumns[0]}, OnDelete: schema.Cascade, }, }, Indexes: []*schema.Index{ { Name: "billinginvoicevalidationissue_id", Unique: true, Columns: []*schema.Column{BillingInvoiceValidationIssuesColumns[0]}, }, { Name: "billinginvoicevalidationissue_namespace", Unique: false, Columns: []*schema.Column{BillingInvoiceValidationIssuesColumns[1]}, }, { Name: "billinginvoicevalidationissue_namespace_invoice_id_dedupe_hash", Unique: true, Columns: []*schema.Column{BillingInvoiceValidationIssuesColumns[1], BillingInvoiceValidationIssuesColumns[11], BillingInvoiceValidationIssuesColumns[10]}, }, }, } // BillingInvoiceWriteSchemaLevelsColumns holds the columns for the "billing_invoice_write_schema_levels" table. BillingInvoiceWriteSchemaLevelsColumns = []*schema.Column{ {Name: "id", Type: field.TypeString}, {Name: "schema_level", Type: field.TypeInt}, } // BillingInvoiceWriteSchemaLevelsTable holds the schema information for the "billing_invoice_write_schema_levels" table. BillingInvoiceWriteSchemaLevelsTable = &schema.Table{ Name: "billing_invoice_write_schema_levels", Columns: BillingInvoiceWriteSchemaLevelsColumns, PrimaryKey: []*schema.Column{BillingInvoiceWriteSchemaLevelsColumns[0]}, Indexes: []*schema.Index{ { Name: "billinginvoicewriteschemalevel_id", Unique: true, Columns: []*schema.Column{BillingInvoiceWriteSchemaLevelsColumns[0]}, }, }, } // BillingProfilesColumns holds the columns for the "billing_profiles" table. BillingProfilesColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "namespace", Type: field.TypeString}, {Name: "metadata", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "name", Type: field.TypeString}, {Name: "description", Type: field.TypeString, Nullable: true}, {Name: "supplier_address_country", Type: field.TypeString, Nullable: true, Size: 2}, {Name: "supplier_address_postal_code", Type: field.TypeString, Nullable: true}, {Name: "supplier_address_state", Type: field.TypeString, Nullable: true}, {Name: "supplier_address_city", Type: field.TypeString, Nullable: true}, {Name: "supplier_address_line1", Type: field.TypeString, Nullable: true}, {Name: "supplier_address_line2", Type: field.TypeString, Nullable: true}, {Name: "supplier_address_phone_number", Type: field.TypeString, Nullable: true}, {Name: "default", Type: field.TypeBool, Default: false}, {Name: "supplier_name", Type: field.TypeString}, {Name: "supplier_tax_code", Type: field.TypeString, Nullable: true}, {Name: "tax_app_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "invoicing_app_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "payment_app_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "workflow_config_id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, } // BillingProfilesTable holds the schema information for the "billing_profiles" table. BillingProfilesTable = &schema.Table{ Name: "billing_profiles", Columns: BillingProfilesColumns, PrimaryKey: []*schema.Column{BillingProfilesColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "billing_profiles_apps_billing_profile_tax_app", Columns: []*schema.Column{BillingProfilesColumns[18]}, RefColumns: []*schema.Column{AppsColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "billing_profiles_apps_billing_profile_invoicing_app", Columns: []*schema.Column{BillingProfilesColumns[19]}, RefColumns: []*schema.Column{AppsColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "billing_profiles_apps_billing_profile_payment_app", Columns: []*schema.Column{BillingProfilesColumns[20]}, RefColumns: []*schema.Column{AppsColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "billing_profiles_billing_workflow_configs_billing_profile", Columns: []*schema.Column{BillingProfilesColumns[21]}, RefColumns: []*schema.Column{BillingWorkflowConfigsColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "billingprofile_id", Unique: true, Columns: []*schema.Column{BillingProfilesColumns[0]}, }, { Name: "billingprofile_namespace", Unique: false, Columns: []*schema.Column{BillingProfilesColumns[1]}, }, { Name: "billingprofile_namespace_id", Unique: true, Columns: []*schema.Column{BillingProfilesColumns[1], BillingProfilesColumns[0]}, }, { Name: "billingprofile_namespace_default", Unique: true, Columns: []*schema.Column{BillingProfilesColumns[1], BillingProfilesColumns[15]}, Annotation: &entsql.IndexAnnotation{ Where: "\"default\" AND deleted_at IS NULL", }, }, }, } // BillingSequenceNumbersColumns holds the columns for the "billing_sequence_numbers" table. BillingSequenceNumbersColumns = []*schema.Column{ {Name: "id", Type: field.TypeInt, Increment: true}, {Name: "namespace", Type: field.TypeString}, {Name: "scope", Type: field.TypeString}, {Name: "last", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, } // BillingSequenceNumbersTable holds the schema information for the "billing_sequence_numbers" table. BillingSequenceNumbersTable = &schema.Table{ Name: "billing_sequence_numbers", Columns: BillingSequenceNumbersColumns, PrimaryKey: []*schema.Column{BillingSequenceNumbersColumns[0]}, Indexes: []*schema.Index{ { Name: "billingsequencenumbers_namespace", Unique: false, Columns: []*schema.Column{BillingSequenceNumbersColumns[1]}, }, { Name: "billingsequencenumbers_namespace_scope", Unique: true, Columns: []*schema.Column{BillingSequenceNumbersColumns[1], BillingSequenceNumbersColumns[2]}, }, }, } // BillingStandardInvoiceDetailedLinesColumns holds the columns for the "billing_standard_invoice_detailed_lines" table. BillingStandardInvoiceDetailedLinesColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "currency", Type: field.TypeString, SchemaType: map[string]string{"postgres": "varchar(3)"}}, {Name: "tax_config", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "tax_behavior", Type: field.TypeEnum, Nullable: true, Enums: []string{"inclusive", "exclusive"}}, {Name: "service_period_start", Type: field.TypeTime}, {Name: "service_period_end", Type: field.TypeTime}, {Name: "quantity", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "invoicing_app_external_id", Type: field.TypeString, Nullable: true}, {Name: "child_unique_reference_id", Type: field.TypeString}, {Name: "per_unit_amount", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "category", Type: field.TypeEnum, Enums: []string{"regular", "commitment"}, Default: "regular"}, {Name: "payment_term", Type: field.TypeEnum, Enums: []string{"in_advance", "in_arrears"}, Default: "in_advance"}, {Name: "index", Type: field.TypeInt, Nullable: true}, {Name: "credits_applied", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "annotations", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "namespace", Type: field.TypeString}, {Name: "metadata", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "name", Type: field.TypeString}, {Name: "description", Type: field.TypeString, Nullable: true}, {Name: "amount", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "taxes_total", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "taxes_inclusive_total", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "taxes_exclusive_total", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "charges_total", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "discounts_total", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "credits_total", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "total", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "invoice_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "parent_line_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "tax_code_id", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, } // BillingStandardInvoiceDetailedLinesTable holds the schema information for the "billing_standard_invoice_detailed_lines" table. BillingStandardInvoiceDetailedLinesTable = &schema.Table{ Name: "billing_standard_invoice_detailed_lines", Columns: BillingStandardInvoiceDetailedLinesColumns, PrimaryKey: []*schema.Column{BillingStandardInvoiceDetailedLinesColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "billing_standard_invoice_detailed_lines_billing_invoices_billing_invoice_detailed_lines", Columns: []*schema.Column{BillingStandardInvoiceDetailedLinesColumns[30]}, RefColumns: []*schema.Column{BillingInvoicesColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "billing_standard_invoice_detailed_lines_billing_invoice_lines_detailed_lines_v2", Columns: []*schema.Column{BillingStandardInvoiceDetailedLinesColumns[31]}, RefColumns: []*schema.Column{BillingInvoiceLinesColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "billing_standard_invoice_detailed_lines_tax_codes_billing_standard_invoice_detailed_lines", Columns: []*schema.Column{BillingStandardInvoiceDetailedLinesColumns[32]}, RefColumns: []*schema.Column{TaxCodesColumns[0]}, OnDelete: schema.SetNull, }, }, Indexes: []*schema.Index{ { Name: "billingstandardinvoicedetailedline_tax_code_id", Unique: false, Columns: []*schema.Column{BillingStandardInvoiceDetailedLinesColumns[32]}, }, { Name: "billingstandardinvoicedetailedline_annotations", Unique: false, Columns: []*schema.Column{BillingStandardInvoiceDetailedLinesColumns[14]}, Annotation: &entsql.IndexAnnotation{ Types: map[string]string{ "postgres": "GIN", }, }, }, { Name: "billingstandardinvoicedetailedline_id", Unique: true, Columns: []*schema.Column{BillingStandardInvoiceDetailedLinesColumns[0]}, }, { Name: "billingstandardinvoicedetailedline_namespace", Unique: false, Columns: []*schema.Column{BillingStandardInvoiceDetailedLinesColumns[15]}, }, { Name: "billingstandardinvoicedetailedline_namespace_id", Unique: true, Columns: []*schema.Column{BillingStandardInvoiceDetailedLinesColumns[15], BillingStandardInvoiceDetailedLinesColumns[0]}, }, { Name: "billingstandardinvoicedetailedline_namespace_invoice_id", Unique: false, Columns: []*schema.Column{BillingStandardInvoiceDetailedLinesColumns[15], BillingStandardInvoiceDetailedLinesColumns[30]}, }, { Name: "billingstandardinvoicedetailedline_namespace_parent_line_id", Unique: false, Columns: []*schema.Column{BillingStandardInvoiceDetailedLinesColumns[15], BillingStandardInvoiceDetailedLinesColumns[31]}, }, { Name: "billingstdinvdetailedline_ns_parent_child_id", Unique: true, Columns: []*schema.Column{BillingStandardInvoiceDetailedLinesColumns[15], BillingStandardInvoiceDetailedLinesColumns[31], BillingStandardInvoiceDetailedLinesColumns[8]}, Annotation: &entsql.IndexAnnotation{ Where: "deleted_at IS NULL", }, }, }, } // BillingStandardInvoiceDetailedLineAmountDiscountsColumns holds the columns for the "billing_standard_invoice_detailed_line_amount_discounts" table. BillingStandardInvoiceDetailedLineAmountDiscountsColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "namespace", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "invoicing_app_external_id", Type: field.TypeString, Nullable: true}, {Name: "child_unique_reference_id", Type: field.TypeString, Nullable: true}, {Name: "description", Type: field.TypeString, Nullable: true}, {Name: "reason", Type: field.TypeEnum, Enums: []string{"maximum_spend", "ratecard_percentage", "ratecard_usage"}}, {Name: "amount", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "rounding_amount", Type: field.TypeOther, Nullable: true, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "source_discount", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "line_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, } // BillingStandardInvoiceDetailedLineAmountDiscountsTable holds the schema information for the "billing_standard_invoice_detailed_line_amount_discounts" table. BillingStandardInvoiceDetailedLineAmountDiscountsTable = &schema.Table{ Name: "billing_standard_invoice_detailed_line_amount_discounts", Columns: BillingStandardInvoiceDetailedLineAmountDiscountsColumns, PrimaryKey: []*schema.Column{BillingStandardInvoiceDetailedLineAmountDiscountsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "billing_standard_invoice_detailed_line_amount_discounts_billing_standard_invoice_detailed_lines_amount_discounts", Columns: []*schema.Column{BillingStandardInvoiceDetailedLineAmountDiscountsColumns[12]}, RefColumns: []*schema.Column{BillingStandardInvoiceDetailedLinesColumns[0]}, OnDelete: schema.Cascade, }, }, Indexes: []*schema.Index{ { Name: "billingstandardinvoicedetailedlineamountdiscount_id", Unique: true, Columns: []*schema.Column{BillingStandardInvoiceDetailedLineAmountDiscountsColumns[0]}, }, { Name: "billingstandardinvoicedetailedlineamountdiscount_namespace", Unique: false, Columns: []*schema.Column{BillingStandardInvoiceDetailedLineAmountDiscountsColumns[1]}, }, { Name: "billingstandardinvoicedetailedlineamountdiscount_namespace_line_id", Unique: false, Columns: []*schema.Column{BillingStandardInvoiceDetailedLineAmountDiscountsColumns[1], BillingStandardInvoiceDetailedLineAmountDiscountsColumns[12]}, }, { Name: "billingstdinvdetailedlineamntdiscount_ns_parent_child_id", Unique: true, Columns: []*schema.Column{BillingStandardInvoiceDetailedLineAmountDiscountsColumns[1], BillingStandardInvoiceDetailedLineAmountDiscountsColumns[12], BillingStandardInvoiceDetailedLineAmountDiscountsColumns[6]}, Annotation: &entsql.IndexAnnotation{ Where: "child_unique_reference_id IS NOT NULL AND deleted_at IS NULL", }, }, }, } // BillingWorkflowConfigsColumns holds the columns for the "billing_workflow_configs" table. BillingWorkflowConfigsColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "namespace", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "tax_behavior", Type: field.TypeEnum, Nullable: true, Enums: []string{"inclusive", "exclusive"}}, {Name: "collection_alignment", Type: field.TypeEnum, Enums: []string{"subscription", "anchored"}}, {Name: "anchored_alignment_detail", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "line_collection_period", Type: field.TypeString}, {Name: "invoice_auto_advance", Type: field.TypeBool}, {Name: "invoice_draft_period", Type: field.TypeString}, {Name: "invoice_due_after", Type: field.TypeString}, {Name: "invoice_collection_method", Type: field.TypeEnum, Enums: []string{"charge_automatically", "send_invoice"}}, {Name: "invoice_progressive_billing", Type: field.TypeBool}, {Name: "invoice_default_tax_settings", Type: field.TypeJSON, Nullable: true}, {Name: "tax_enabled", Type: field.TypeBool, Default: true}, {Name: "tax_enforced", Type: field.TypeBool, Default: false}, {Name: "tax_code_id", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, } // BillingWorkflowConfigsTable holds the schema information for the "billing_workflow_configs" table. BillingWorkflowConfigsTable = &schema.Table{ Name: "billing_workflow_configs", Columns: BillingWorkflowConfigsColumns, PrimaryKey: []*schema.Column{BillingWorkflowConfigsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "billing_workflow_configs_tax_codes_billing_workflow_configs", Columns: []*schema.Column{BillingWorkflowConfigsColumns[17]}, RefColumns: []*schema.Column{TaxCodesColumns[0]}, OnDelete: schema.SetNull, }, }, Indexes: []*schema.Index{ { Name: "billingworkflowconfig_id", Unique: true, Columns: []*schema.Column{BillingWorkflowConfigsColumns[0]}, }, { Name: "billingworkflowconfig_namespace", Unique: false, Columns: []*schema.Column{BillingWorkflowConfigsColumns[1]}, }, { Name: "billingworkflowconfig_tax_code_id", Unique: false, Columns: []*schema.Column{BillingWorkflowConfigsColumns[17]}, }, { Name: "billingworkflowconfig_namespace_id", Unique: false, Columns: []*schema.Column{BillingWorkflowConfigsColumns[1], BillingWorkflowConfigsColumns[0]}, }, }, } // ChargesColumns holds the columns for the "charges" table. ChargesColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "namespace", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "unique_reference_id", Type: field.TypeString, Nullable: true}, {Name: "type", Type: field.TypeString}, {Name: "charge_credit_purchase_id", Type: field.TypeString, Unique: true, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "charge_flat_fee_id", Type: field.TypeString, Unique: true, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "charge_usage_based_id", Type: field.TypeString, Unique: true, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, } // ChargesTable holds the schema information for the "charges" table. ChargesTable = &schema.Table{ Name: "charges", Columns: ChargesColumns, PrimaryKey: []*schema.Column{ChargesColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "charges_charge_credit_purchases_charge", Columns: []*schema.Column{ChargesColumns[6]}, RefColumns: []*schema.Column{ChargeCreditPurchasesColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "charges_charge_flat_fees_charge", Columns: []*schema.Column{ChargesColumns[7]}, RefColumns: []*schema.Column{ChargeFlatFeesColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "charges_charge_usage_based_charge", Columns: []*schema.Column{ChargesColumns[8]}, RefColumns: []*schema.Column{ChargeUsageBasedColumns[0]}, OnDelete: schema.Cascade, }, }, Indexes: []*schema.Index{ { Name: "charge_namespace", Unique: false, Columns: []*schema.Column{ChargesColumns[1]}, }, { Name: "charge_id", Unique: true, Columns: []*schema.Column{ChargesColumns[0]}, }, { Name: "charge_namespace_unique_reference_id", Unique: true, Columns: []*schema.Column{ChargesColumns[1], ChargesColumns[4]}, Annotation: &entsql.IndexAnnotation{ Where: "unique_reference_id IS NOT NULL AND deleted_at IS NULL", }, }, }, } // ChargeCreditPurchasesColumns holds the columns for the "charge_credit_purchases" table. ChargeCreditPurchasesColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "service_period_from", Type: field.TypeTime}, {Name: "service_period_to", Type: field.TypeTime}, {Name: "billing_period_from", Type: field.TypeTime}, {Name: "billing_period_to", Type: field.TypeTime}, {Name: "full_service_period_from", Type: field.TypeTime}, {Name: "full_service_period_to", Type: field.TypeTime}, {Name: "status", Type: field.TypeEnum, Enums: []string{"created", "active", "final", "deleted"}}, {Name: "unique_reference_id", Type: field.TypeString, Nullable: true}, {Name: "currency", Type: field.TypeString, SchemaType: map[string]string{"postgres": "varchar(3)"}}, {Name: "managed_by", Type: field.TypeEnum, Enums: []string{"subscription", "system", "manual"}}, {Name: "advance_after", Type: field.TypeTime, Nullable: true}, {Name: "tax_behavior", Type: field.TypeEnum, Nullable: true, Enums: []string{"inclusive", "exclusive"}}, {Name: "annotations", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "namespace", Type: field.TypeString}, {Name: "metadata", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "name", Type: field.TypeString}, {Name: "description", Type: field.TypeString, Nullable: true}, {Name: "credit_amount", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "effective_at", Type: field.TypeTime, Nullable: true}, {Name: "priority", Type: field.TypeInt, Nullable: true}, {Name: "settlement", Type: field.TypeString, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "status_detailed", Type: field.TypeEnum, Enums: []string{"created", "active", "final", "deleted"}}, {Name: "customer_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "subscription_id", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "subscription_item_id", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "subscription_phase_id", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "tax_code_id", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, } // ChargeCreditPurchasesTable holds the schema information for the "charge_credit_purchases" table. ChargeCreditPurchasesTable = &schema.Table{ Name: "charge_credit_purchases", Columns: ChargeCreditPurchasesColumns, PrimaryKey: []*schema.Column{ChargeCreditPurchasesColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "charge_credit_purchases_customers_charges_credit_purchase", Columns: []*schema.Column{ChargeCreditPurchasesColumns[26]}, RefColumns: []*schema.Column{CustomersColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "charge_credit_purchases_subscriptions_charges_credit_purchase", Columns: []*schema.Column{ChargeCreditPurchasesColumns[27]}, RefColumns: []*schema.Column{SubscriptionsColumns[0]}, OnDelete: schema.SetNull, }, { Symbol: "charge_credit_purchases_subscription_items_charges_credit_purchase", Columns: []*schema.Column{ChargeCreditPurchasesColumns[28]}, RefColumns: []*schema.Column{SubscriptionItemsColumns[0]}, OnDelete: schema.SetNull, }, { Symbol: "charge_credit_purchases_subscription_phases_charges_credit_purchase", Columns: []*schema.Column{ChargeCreditPurchasesColumns[29]}, RefColumns: []*schema.Column{SubscriptionPhasesColumns[0]}, OnDelete: schema.SetNull, }, { Symbol: "charge_credit_purchases_tax_codes_charge_credit_purchases", Columns: []*schema.Column{ChargeCreditPurchasesColumns[30]}, RefColumns: []*schema.Column{TaxCodesColumns[0]}, OnDelete: schema.SetNull, }, }, Indexes: []*schema.Index{ { Name: "chargecreditpurchase_namespace_customer_id_unique_reference_id", Unique: true, Columns: []*schema.Column{ChargeCreditPurchasesColumns[14], ChargeCreditPurchasesColumns[26], ChargeCreditPurchasesColumns[8]}, Annotation: &entsql.IndexAnnotation{ Where: "unique_reference_id IS NOT NULL AND deleted_at IS NULL", }, }, { Name: "chargecreditpurchase_annotations", Unique: false, Columns: []*schema.Column{ChargeCreditPurchasesColumns[13]}, Annotation: &entsql.IndexAnnotation{ Types: map[string]string{ "postgres": "GIN", }, }, }, { Name: "chargecreditpurchase_id", Unique: true, Columns: []*schema.Column{ChargeCreditPurchasesColumns[0]}, }, { Name: "chargecreditpurchase_namespace", Unique: false, Columns: []*schema.Column{ChargeCreditPurchasesColumns[14]}, }, { Name: "chargecreditpurchase_namespace_id", Unique: true, Columns: []*schema.Column{ChargeCreditPurchasesColumns[14], ChargeCreditPurchasesColumns[0]}, }, { Name: "chargecreditpurchases_tax_code_id", Unique: false, Columns: []*schema.Column{ChargeCreditPurchasesColumns[30]}, }, }, } // ChargeCreditPurchaseCreditGrantsColumns holds the columns for the "charge_credit_purchase_credit_grants" table. ChargeCreditPurchaseCreditGrantsColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "namespace", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "transaction_group_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "granted_at", Type: field.TypeTime}, {Name: "charge_id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, } // ChargeCreditPurchaseCreditGrantsTable holds the schema information for the "charge_credit_purchase_credit_grants" table. ChargeCreditPurchaseCreditGrantsTable = &schema.Table{ Name: "charge_credit_purchase_credit_grants", Columns: ChargeCreditPurchaseCreditGrantsColumns, PrimaryKey: []*schema.Column{ChargeCreditPurchaseCreditGrantsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "charge_credit_purchase_credit_grants_charge_credit_purchases_credit_grant", Columns: []*schema.Column{ChargeCreditPurchaseCreditGrantsColumns[7]}, RefColumns: []*schema.Column{ChargeCreditPurchasesColumns[0]}, OnDelete: schema.Cascade, }, }, Indexes: []*schema.Index{ { Name: "chargecreditpurchasecreditgrant_namespace", Unique: false, Columns: []*schema.Column{ChargeCreditPurchaseCreditGrantsColumns[1]}, }, { Name: "chargecreditpurchasecreditgrant_id", Unique: true, Columns: []*schema.Column{ChargeCreditPurchaseCreditGrantsColumns[0]}, }, { Name: "chargecreditpurchasecreditgrant_namespace_charge_id", Unique: true, Columns: []*schema.Column{ChargeCreditPurchaseCreditGrantsColumns[1], ChargeCreditPurchaseCreditGrantsColumns[7]}, }, }, } // ChargeCreditPurchaseExternalPaymentsColumns holds the columns for the "charge_credit_purchase_external_payments" table. ChargeCreditPurchaseExternalPaymentsColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "service_period_from", Type: field.TypeTime}, {Name: "service_period_to", Type: field.TypeTime}, {Name: "status", Type: field.TypeEnum, Enums: []string{"authorized", "settled"}}, {Name: "amount", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "authorized_transaction_group_id", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "authorized_at", Type: field.TypeTime, Nullable: true}, {Name: "settled_transaction_group_id", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "settled_at", Type: field.TypeTime, Nullable: true}, {Name: "namespace", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "annotations", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "charge_id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, } // ChargeCreditPurchaseExternalPaymentsTable holds the schema information for the "charge_credit_purchase_external_payments" table. ChargeCreditPurchaseExternalPaymentsTable = &schema.Table{ Name: "charge_credit_purchase_external_payments", Columns: ChargeCreditPurchaseExternalPaymentsColumns, PrimaryKey: []*schema.Column{ChargeCreditPurchaseExternalPaymentsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "charge_credit_purchase_external_payments_charge_credit_purchases_external_payment", Columns: []*schema.Column{ChargeCreditPurchaseExternalPaymentsColumns[14]}, RefColumns: []*schema.Column{ChargeCreditPurchasesColumns[0]}, OnDelete: schema.Cascade, }, }, Indexes: []*schema.Index{ { Name: "chargecreditpurchaseexternalpayment_namespace", Unique: false, Columns: []*schema.Column{ChargeCreditPurchaseExternalPaymentsColumns[9]}, }, { Name: "chargecreditpurchaseexternalpayment_id", Unique: true, Columns: []*schema.Column{ChargeCreditPurchaseExternalPaymentsColumns[0]}, }, { Name: "chargecreditpurchaseexternalpayment_annotations", Unique: false, Columns: []*schema.Column{ChargeCreditPurchaseExternalPaymentsColumns[13]}, Annotation: &entsql.IndexAnnotation{ Types: map[string]string{ "postgres": "GIN", }, }, }, }, } // ChargeCreditPurchaseInvoicedPaymentsColumns holds the columns for the "charge_credit_purchase_invoiced_payments" table. ChargeCreditPurchaseInvoicedPaymentsColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "invoice_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "service_period_from", Type: field.TypeTime}, {Name: "service_period_to", Type: field.TypeTime}, {Name: "status", Type: field.TypeEnum, Enums: []string{"authorized", "settled"}}, {Name: "amount", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "authorized_transaction_group_id", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "authorized_at", Type: field.TypeTime, Nullable: true}, {Name: "settled_transaction_group_id", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "settled_at", Type: field.TypeTime, Nullable: true}, {Name: "namespace", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "annotations", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "line_id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "charge_id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, } // ChargeCreditPurchaseInvoicedPaymentsTable holds the schema information for the "charge_credit_purchase_invoiced_payments" table. ChargeCreditPurchaseInvoicedPaymentsTable = &schema.Table{ Name: "charge_credit_purchase_invoiced_payments", Columns: ChargeCreditPurchaseInvoicedPaymentsColumns, PrimaryKey: []*schema.Column{ChargeCreditPurchaseInvoicedPaymentsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "charge_credit_purchase_invoiced_payments_billing_invoice_lines_charge_credit_purchase_invoiced_payment", Columns: []*schema.Column{ChargeCreditPurchaseInvoicedPaymentsColumns[15]}, RefColumns: []*schema.Column{BillingInvoiceLinesColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "charge_credit_purchase_invoiced_payments_charge_credit_purchases_invoiced_payment", Columns: []*schema.Column{ChargeCreditPurchaseInvoicedPaymentsColumns[16]}, RefColumns: []*schema.Column{ChargeCreditPurchasesColumns[0]}, OnDelete: schema.Cascade, }, }, Indexes: []*schema.Index{ { Name: "chargecreditpurchaseinvoicedpayment_namespace", Unique: false, Columns: []*schema.Column{ChargeCreditPurchaseInvoicedPaymentsColumns[10]}, }, { Name: "chargecreditpurchaseinvoicedpayment_id", Unique: true, Columns: []*schema.Column{ChargeCreditPurchaseInvoicedPaymentsColumns[0]}, }, { Name: "chargecreditpurchaseinvoicedpayment_annotations", Unique: false, Columns: []*schema.Column{ChargeCreditPurchaseInvoicedPaymentsColumns[14]}, Annotation: &entsql.IndexAnnotation{ Types: map[string]string{ "postgres": "GIN", }, }, }, { Name: "chargecreditpurchaseinvoicedpayment_namespace_charge_id", Unique: true, Columns: []*schema.Column{ChargeCreditPurchaseInvoicedPaymentsColumns[10], ChargeCreditPurchaseInvoicedPaymentsColumns[16]}, }, }, } // ChargeFlatFeesColumns holds the columns for the "charge_flat_fees" table. ChargeFlatFeesColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "service_period_from", Type: field.TypeTime}, {Name: "service_period_to", Type: field.TypeTime}, {Name: "billing_period_from", Type: field.TypeTime}, {Name: "billing_period_to", Type: field.TypeTime}, {Name: "full_service_period_from", Type: field.TypeTime}, {Name: "full_service_period_to", Type: field.TypeTime}, {Name: "status", Type: field.TypeEnum, Enums: []string{"created", "active", "final", "deleted"}}, {Name: "unique_reference_id", Type: field.TypeString, Nullable: true}, {Name: "currency", Type: field.TypeString, SchemaType: map[string]string{"postgres": "varchar(3)"}}, {Name: "managed_by", Type: field.TypeEnum, Enums: []string{"subscription", "system", "manual"}}, {Name: "advance_after", Type: field.TypeTime, Nullable: true}, {Name: "tax_behavior", Type: field.TypeEnum, Nullable: true, Enums: []string{"inclusive", "exclusive"}}, {Name: "annotations", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "namespace", Type: field.TypeString}, {Name: "metadata", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "name", Type: field.TypeString}, {Name: "description", Type: field.TypeString, Nullable: true}, {Name: "payment_term", Type: field.TypeString}, {Name: "invoice_at", Type: field.TypeTime}, {Name: "settlement_mode", Type: field.TypeEnum, Enums: []string{"credit_then_invoice", "credit_only"}}, {Name: "discounts", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "pro_rating", Type: field.TypeEnum, Enums: []string{"prorate_prices", "no_prorate"}}, {Name: "feature_key", Type: field.TypeString, Nullable: true}, {Name: "amount_before_proration", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "amount_after_proration", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "status_detailed", Type: field.TypeEnum, Enums: []string{"created", "active", "active.realization.started", "active.realization.waiting_for_collection", "active.realization.processing", "active.realization.issuing", "active.realization.completed", "active.awaiting_payment_settlement", "final", "deleted"}}, {Name: "current_realization_run_id", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "customer_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "feature_id", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "subscription_id", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "subscription_item_id", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "subscription_phase_id", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "tax_code_id", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, } // ChargeFlatFeesTable holds the schema information for the "charge_flat_fees" table. ChargeFlatFeesTable = &schema.Table{ Name: "charge_flat_fees", Columns: ChargeFlatFeesColumns, PrimaryKey: []*schema.Column{ChargeFlatFeesColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "charge_flat_fees_charge_flat_fee_runs_current_run", Columns: []*schema.Column{ChargeFlatFeesColumns[30]}, RefColumns: []*schema.Column{ChargeFlatFeeRunsColumns[0]}, OnDelete: schema.SetNull, }, { Symbol: "charge_flat_fees_customers_charges_flat_fee", Columns: []*schema.Column{ChargeFlatFeesColumns[31]}, RefColumns: []*schema.Column{CustomersColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "charge_flat_fees_features_flat_fee_charges", Columns: []*schema.Column{ChargeFlatFeesColumns[32]}, RefColumns: []*schema.Column{FeaturesColumns[0]}, OnDelete: schema.SetNull, }, { Symbol: "charge_flat_fees_subscriptions_charges_flat_fee", Columns: []*schema.Column{ChargeFlatFeesColumns[33]}, RefColumns: []*schema.Column{SubscriptionsColumns[0]}, OnDelete: schema.SetNull, }, { Symbol: "charge_flat_fees_subscription_items_charges_flat_fee", Columns: []*schema.Column{ChargeFlatFeesColumns[34]}, RefColumns: []*schema.Column{SubscriptionItemsColumns[0]}, OnDelete: schema.SetNull, }, { Symbol: "charge_flat_fees_subscription_phases_charges_flat_fee", Columns: []*schema.Column{ChargeFlatFeesColumns[35]}, RefColumns: []*schema.Column{SubscriptionPhasesColumns[0]}, OnDelete: schema.SetNull, }, { Symbol: "charge_flat_fees_tax_codes_charge_flat_fees", Columns: []*schema.Column{ChargeFlatFeesColumns[36]}, RefColumns: []*schema.Column{TaxCodesColumns[0]}, OnDelete: schema.SetNull, }, }, Indexes: []*schema.Index{ { Name: "chargeflatfee_namespace_customer_id_unique_reference_id", Unique: true, Columns: []*schema.Column{ChargeFlatFeesColumns[14], ChargeFlatFeesColumns[31], ChargeFlatFeesColumns[8]}, Annotation: &entsql.IndexAnnotation{ Where: "unique_reference_id IS NOT NULL AND deleted_at IS NULL", }, }, { Name: "chargeflatfee_annotations", Unique: false, Columns: []*schema.Column{ChargeFlatFeesColumns[13]}, Annotation: &entsql.IndexAnnotation{ Types: map[string]string{ "postgres": "GIN", }, }, }, { Name: "chargeflatfee_id", Unique: true, Columns: []*schema.Column{ChargeFlatFeesColumns[0]}, }, { Name: "chargeflatfee_namespace", Unique: false, Columns: []*schema.Column{ChargeFlatFeesColumns[14]}, }, { Name: "chargeflatfee_namespace_id", Unique: true, Columns: []*schema.Column{ChargeFlatFeesColumns[14], ChargeFlatFeesColumns[0]}, }, { Name: "chargeflatfees_tax_code_id", Unique: false, Columns: []*schema.Column{ChargeFlatFeesColumns[36]}, }, }, } // ChargeFlatFeeRunsColumns holds the columns for the "charge_flat_fee_runs" table. ChargeFlatFeeRunsColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "namespace", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "amount", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "taxes_total", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "taxes_inclusive_total", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "taxes_exclusive_total", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "charges_total", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "discounts_total", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "credits_total", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "total", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "type", Type: field.TypeEnum, Enums: []string{"final_realization", "invalid_due_to_unsupported_credit_note"}}, {Name: "initial_type", Type: field.TypeEnum, Enums: []string{"final_realization", "invalid_due_to_unsupported_credit_note"}}, {Name: "service_period_from", Type: field.TypeTime}, {Name: "service_period_to", Type: field.TypeTime}, {Name: "amount_after_proration", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "no_fiat_transaction_required", Type: field.TypeBool}, {Name: "immutable", Type: field.TypeBool}, {Name: "invoice_id", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "line_id", Type: field.TypeString, Unique: true, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "charge_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, } // ChargeFlatFeeRunsTable holds the schema information for the "charge_flat_fee_runs" table. ChargeFlatFeeRunsTable = &schema.Table{ Name: "charge_flat_fee_runs", Columns: ChargeFlatFeeRunsColumns, PrimaryKey: []*schema.Column{ChargeFlatFeeRunsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "charge_flat_fee_runs_billing_invoices_charge_flat_fee_runs", Columns: []*schema.Column{ChargeFlatFeeRunsColumns[20]}, RefColumns: []*schema.Column{BillingInvoicesColumns[0]}, OnDelete: schema.SetNull, }, { Symbol: "charge_flat_fee_runs_billing_invoice_lines_charge_flat_fee_runs", Columns: []*schema.Column{ChargeFlatFeeRunsColumns[21]}, RefColumns: []*schema.Column{BillingInvoiceLinesColumns[0]}, OnDelete: schema.SetNull, }, { Symbol: "charge_flat_fee_runs_charge_flat_fees_runs", Columns: []*schema.Column{ChargeFlatFeeRunsColumns[22]}, RefColumns: []*schema.Column{ChargeFlatFeesColumns[0]}, OnDelete: schema.Cascade, }, }, Indexes: []*schema.Index{ { Name: "chargeflatfeerun_namespace", Unique: false, Columns: []*schema.Column{ChargeFlatFeeRunsColumns[1]}, }, { Name: "chargeflatfeerun_id", Unique: true, Columns: []*schema.Column{ChargeFlatFeeRunsColumns[0]}, }, { Name: "chargeflatfeerun_namespace_charge_id", Unique: false, Columns: []*schema.Column{ChargeFlatFeeRunsColumns[1], ChargeFlatFeeRunsColumns[22]}, }, }, } // ChargeFlatFeeRunCreditAllocationsColumns holds the columns for the "charge_flat_fee_run_credit_allocations" table. ChargeFlatFeeRunCreditAllocationsColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "amount", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "service_period_from", Type: field.TypeTime}, {Name: "service_period_to", Type: field.TypeTime}, {Name: "ledger_transaction_group_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "sort_hint", Type: field.TypeInt}, {Name: "type", Type: field.TypeEnum, Enums: []string{"allocation", "correction"}}, {Name: "namespace", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "annotations", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "line_id", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "run_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "corrects_realization_id", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, } // ChargeFlatFeeRunCreditAllocationsTable holds the schema information for the "charge_flat_fee_run_credit_allocations" table. ChargeFlatFeeRunCreditAllocationsTable = &schema.Table{ Name: "charge_flat_fee_run_credit_allocations", Columns: ChargeFlatFeeRunCreditAllocationsColumns, PrimaryKey: []*schema.Column{ChargeFlatFeeRunCreditAllocationsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "charge_flat_fee_run_credit_allocations_billing_invoice_lines_charge_flat_fee_run_credit_allocations", Columns: []*schema.Column{ChargeFlatFeeRunCreditAllocationsColumns[12]}, RefColumns: []*schema.Column{BillingInvoiceLinesColumns[0]}, OnDelete: schema.SetNull, }, { Symbol: "charge_ff_credit_alloc_run", Columns: []*schema.Column{ChargeFlatFeeRunCreditAllocationsColumns[13]}, RefColumns: []*schema.Column{ChargeFlatFeeRunsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "charge_flat_fee_run_credit_allocations_charge_flat_fee_run_credit_allocations_allocation", Columns: []*schema.Column{ChargeFlatFeeRunCreditAllocationsColumns[14]}, RefColumns: []*schema.Column{ChargeFlatFeeRunCreditAllocationsColumns[0]}, OnDelete: schema.SetNull, }, }, Indexes: []*schema.Index{ { Name: "chargeflatfeeruncreditallocations_namespace", Unique: false, Columns: []*schema.Column{ChargeFlatFeeRunCreditAllocationsColumns[7]}, }, { Name: "chargeflatfeeruncreditallocations_id", Unique: true, Columns: []*schema.Column{ChargeFlatFeeRunCreditAllocationsColumns[0]}, }, { Name: "chargeflatfeeruncreditallocations_annotations", Unique: false, Columns: []*schema.Column{ChargeFlatFeeRunCreditAllocationsColumns[11]}, Annotation: &entsql.IndexAnnotation{ Types: map[string]string{ "postgres": "GIN", }, }, }, }, } // ChargeFlatFeeRunDetailedLinesColumns holds the columns for the "charge_flat_fee_run_detailed_lines" table. ChargeFlatFeeRunDetailedLinesColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "currency", Type: field.TypeString, SchemaType: map[string]string{"postgres": "varchar(3)"}}, {Name: "tax_config", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "tax_behavior", Type: field.TypeEnum, Nullable: true, Enums: []string{"inclusive", "exclusive"}}, {Name: "service_period_start", Type: field.TypeTime}, {Name: "service_period_end", Type: field.TypeTime}, {Name: "quantity", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "invoicing_app_external_id", Type: field.TypeString, Nullable: true}, {Name: "child_unique_reference_id", Type: field.TypeString}, {Name: "per_unit_amount", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "category", Type: field.TypeEnum, Enums: []string{"regular", "commitment"}, Default: "regular"}, {Name: "payment_term", Type: field.TypeEnum, Enums: []string{"in_advance", "in_arrears"}, Default: "in_advance"}, {Name: "index", Type: field.TypeInt, Nullable: true}, {Name: "credits_applied", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "annotations", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "namespace", Type: field.TypeString}, {Name: "metadata", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "name", Type: field.TypeString}, {Name: "description", Type: field.TypeString, Nullable: true}, {Name: "amount", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "taxes_total", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "taxes_inclusive_total", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "taxes_exclusive_total", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "charges_total", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "discounts_total", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "credits_total", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "total", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "pricer_reference_id", Type: field.TypeString}, {Name: "run_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "tax_code_id", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, } // ChargeFlatFeeRunDetailedLinesTable holds the schema information for the "charge_flat_fee_run_detailed_lines" table. ChargeFlatFeeRunDetailedLinesTable = &schema.Table{ Name: "charge_flat_fee_run_detailed_lines", Columns: ChargeFlatFeeRunDetailedLinesColumns, PrimaryKey: []*schema.Column{ChargeFlatFeeRunDetailedLinesColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "charge_flat_fee_run_detailed_lines_charge_flat_fee_runs_detailed_lines", Columns: []*schema.Column{ChargeFlatFeeRunDetailedLinesColumns[31]}, RefColumns: []*schema.Column{ChargeFlatFeeRunsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "charge_flat_fee_run_detailed_lines_tax_codes_charge_flat_fee_run_detailed_lines", Columns: []*schema.Column{ChargeFlatFeeRunDetailedLinesColumns[32]}, RefColumns: []*schema.Column{TaxCodesColumns[0]}, OnDelete: schema.SetNull, }, }, Indexes: []*schema.Index{ { Name: "chargeflatfeerundetailedline_tax_code_id", Unique: false, Columns: []*schema.Column{ChargeFlatFeeRunDetailedLinesColumns[32]}, }, { Name: "chargeflatfeerundetailedline_annotations", Unique: false, Columns: []*schema.Column{ChargeFlatFeeRunDetailedLinesColumns[14]}, Annotation: &entsql.IndexAnnotation{ Types: map[string]string{ "postgres": "GIN", }, }, }, { Name: "chargeflatfeerundetailedline_id", Unique: true, Columns: []*schema.Column{ChargeFlatFeeRunDetailedLinesColumns[0]}, }, { Name: "chargeflatfeerundetailedline_namespace", Unique: false, Columns: []*schema.Column{ChargeFlatFeeRunDetailedLinesColumns[15]}, }, { Name: "chargeflatfeerundetailedline_namespace_id", Unique: true, Columns: []*schema.Column{ChargeFlatFeeRunDetailedLinesColumns[15], ChargeFlatFeeRunDetailedLinesColumns[0]}, }, { Name: "chargeflatfeerundetailedline_namespace_run_id", Unique: false, Columns: []*schema.Column{ChargeFlatFeeRunDetailedLinesColumns[15], ChargeFlatFeeRunDetailedLinesColumns[31]}, }, { Name: "chargeffdetailedline_ns_run_child_id", Unique: true, Columns: []*schema.Column{ChargeFlatFeeRunDetailedLinesColumns[15], ChargeFlatFeeRunDetailedLinesColumns[31], ChargeFlatFeeRunDetailedLinesColumns[8]}, Annotation: &entsql.IndexAnnotation{ Where: "deleted_at IS NULL", }, }, }, } // ChargeFlatFeeRunInvoicedUsagesColumns holds the columns for the "charge_flat_fee_run_invoiced_usages" table. ChargeFlatFeeRunInvoicedUsagesColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "service_period_from", Type: field.TypeTime}, {Name: "service_period_to", Type: field.TypeTime}, {Name: "ledger_transaction_group_id", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "namespace", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "annotations", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "amount", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "taxes_total", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "taxes_inclusive_total", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "taxes_exclusive_total", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "charges_total", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "discounts_total", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "credits_total", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "total", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "run_id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, } // ChargeFlatFeeRunInvoicedUsagesTable holds the schema information for the "charge_flat_fee_run_invoiced_usages" table. ChargeFlatFeeRunInvoicedUsagesTable = &schema.Table{ Name: "charge_flat_fee_run_invoiced_usages", Columns: ChargeFlatFeeRunInvoicedUsagesColumns, PrimaryKey: []*schema.Column{ChargeFlatFeeRunInvoicedUsagesColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "charge_flat_fee_run_invoiced_usages_charge_flat_fee_runs_invoiced_usage", Columns: []*schema.Column{ChargeFlatFeeRunInvoicedUsagesColumns[17]}, RefColumns: []*schema.Column{ChargeFlatFeeRunsColumns[0]}, OnDelete: schema.Cascade, }, }, Indexes: []*schema.Index{ { Name: "chargeflatfeeruninvoicedusage_namespace", Unique: false, Columns: []*schema.Column{ChargeFlatFeeRunInvoicedUsagesColumns[4]}, }, { Name: "chargeflatfeeruninvoicedusage_id", Unique: true, Columns: []*schema.Column{ChargeFlatFeeRunInvoicedUsagesColumns[0]}, }, { Name: "chargeflatfeeruninvoicedusage_annotations", Unique: false, Columns: []*schema.Column{ChargeFlatFeeRunInvoicedUsagesColumns[8]}, Annotation: &entsql.IndexAnnotation{ Types: map[string]string{ "postgres": "GIN", }, }, }, { Name: "chargeflatfeeruninvoicedusage_namespace_run_id", Unique: true, Columns: []*schema.Column{ChargeFlatFeeRunInvoicedUsagesColumns[4], ChargeFlatFeeRunInvoicedUsagesColumns[17]}, }, }, } // ChargeFlatFeeRunPaymentsColumns holds the columns for the "charge_flat_fee_run_payments" table. ChargeFlatFeeRunPaymentsColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "invoice_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "service_period_from", Type: field.TypeTime}, {Name: "service_period_to", Type: field.TypeTime}, {Name: "status", Type: field.TypeEnum, Enums: []string{"authorized", "settled"}}, {Name: "amount", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "authorized_transaction_group_id", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "authorized_at", Type: field.TypeTime, Nullable: true}, {Name: "settled_transaction_group_id", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "settled_at", Type: field.TypeTime, Nullable: true}, {Name: "namespace", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "annotations", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "line_id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "run_id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, } // ChargeFlatFeeRunPaymentsTable holds the schema information for the "charge_flat_fee_run_payments" table. ChargeFlatFeeRunPaymentsTable = &schema.Table{ Name: "charge_flat_fee_run_payments", Columns: ChargeFlatFeeRunPaymentsColumns, PrimaryKey: []*schema.Column{ChargeFlatFeeRunPaymentsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "charge_flat_fee_run_payments_billing_invoice_lines_charge_flat_fee_run_payment", Columns: []*schema.Column{ChargeFlatFeeRunPaymentsColumns[15]}, RefColumns: []*schema.Column{BillingInvoiceLinesColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "charge_flat_fee_run_payments_charge_flat_fee_runs_payment", Columns: []*schema.Column{ChargeFlatFeeRunPaymentsColumns[16]}, RefColumns: []*schema.Column{ChargeFlatFeeRunsColumns[0]}, OnDelete: schema.Cascade, }, }, Indexes: []*schema.Index{ { Name: "chargeflatfeerunpayment_namespace", Unique: false, Columns: []*schema.Column{ChargeFlatFeeRunPaymentsColumns[10]}, }, { Name: "chargeflatfeerunpayment_id", Unique: true, Columns: []*schema.Column{ChargeFlatFeeRunPaymentsColumns[0]}, }, { Name: "chargeflatfeerunpayment_annotations", Unique: false, Columns: []*schema.Column{ChargeFlatFeeRunPaymentsColumns[14]}, Annotation: &entsql.IndexAnnotation{ Types: map[string]string{ "postgres": "GIN", }, }, }, }, } // ChargeUsageBasedColumns holds the columns for the "charge_usage_based" table. ChargeUsageBasedColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "service_period_from", Type: field.TypeTime}, {Name: "service_period_to", Type: field.TypeTime}, {Name: "billing_period_from", Type: field.TypeTime}, {Name: "billing_period_to", Type: field.TypeTime}, {Name: "full_service_period_from", Type: field.TypeTime}, {Name: "full_service_period_to", Type: field.TypeTime}, {Name: "status", Type: field.TypeEnum, Enums: []string{"created", "active", "final", "deleted"}}, {Name: "unique_reference_id", Type: field.TypeString, Nullable: true}, {Name: "currency", Type: field.TypeString, SchemaType: map[string]string{"postgres": "varchar(3)"}}, {Name: "managed_by", Type: field.TypeEnum, Enums: []string{"subscription", "system", "manual"}}, {Name: "advance_after", Type: field.TypeTime, Nullable: true}, {Name: "tax_behavior", Type: field.TypeEnum, Nullable: true, Enums: []string{"inclusive", "exclusive"}}, {Name: "annotations", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "namespace", Type: field.TypeString}, {Name: "metadata", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "name", Type: field.TypeString}, {Name: "description", Type: field.TypeString, Nullable: true}, {Name: "invoice_at", Type: field.TypeTime}, {Name: "settlement_mode", Type: field.TypeEnum, Enums: []string{"credit_then_invoice", "credit_only"}}, {Name: "discounts", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "feature_key", Type: field.TypeString}, {Name: "rating_engine", Type: field.TypeEnum, Enums: []string{"delta", "period_preserving"}}, {Name: "price", Type: field.TypeString, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "status_detailed", Type: field.TypeEnum, Enums: []string{"created", "active", "active.partial_invoice.started", "active.partial_invoice.waiting_for_collection", "active.partial_invoice.processing", "active.partial_invoice.issuing", "active.partial_invoice.completed", "active.final_realization.started", "active.final_realization.waiting_for_collection", "active.final_realization.processing", "active.final_realization.issuing", "active.final_realization.completed", "active.awaiting_payment_settlement", "final", "deleted"}}, {Name: "current_realization_run_id", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "customer_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "feature_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "subscription_id", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "subscription_item_id", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "subscription_phase_id", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "tax_code_id", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, } // ChargeUsageBasedTable holds the schema information for the "charge_usage_based" table. ChargeUsageBasedTable = &schema.Table{ Name: "charge_usage_based", Columns: ChargeUsageBasedColumns, PrimaryKey: []*schema.Column{ChargeUsageBasedColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "charge_usage_based_charge_usage_based_runs_current_run", Columns: []*schema.Column{ChargeUsageBasedColumns[28]}, RefColumns: []*schema.Column{ChargeUsageBasedRunsColumns[0]}, OnDelete: schema.SetNull, }, { Symbol: "charge_usage_based_customers_charges_usage_based", Columns: []*schema.Column{ChargeUsageBasedColumns[29]}, RefColumns: []*schema.Column{CustomersColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "charge_usage_based_features_usage_based_charges", Columns: []*schema.Column{ChargeUsageBasedColumns[30]}, RefColumns: []*schema.Column{FeaturesColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "charge_usage_based_subscriptions_charges_usage_based", Columns: []*schema.Column{ChargeUsageBasedColumns[31]}, RefColumns: []*schema.Column{SubscriptionsColumns[0]}, OnDelete: schema.SetNull, }, { Symbol: "charge_usage_based_subscription_items_charges_usage_based", Columns: []*schema.Column{ChargeUsageBasedColumns[32]}, RefColumns: []*schema.Column{SubscriptionItemsColumns[0]}, OnDelete: schema.SetNull, }, { Symbol: "charge_usage_based_subscription_phases_charges_usage_based", Columns: []*schema.Column{ChargeUsageBasedColumns[33]}, RefColumns: []*schema.Column{SubscriptionPhasesColumns[0]}, OnDelete: schema.SetNull, }, { Symbol: "charge_usage_based_tax_codes_charge_usage_based", Columns: []*schema.Column{ChargeUsageBasedColumns[34]}, RefColumns: []*schema.Column{TaxCodesColumns[0]}, OnDelete: schema.SetNull, }, }, Indexes: []*schema.Index{ { Name: "chargeusagebased_namespace_customer_id_unique_reference_id", Unique: true, Columns: []*schema.Column{ChargeUsageBasedColumns[14], ChargeUsageBasedColumns[29], ChargeUsageBasedColumns[8]}, Annotation: &entsql.IndexAnnotation{ Where: "unique_reference_id IS NOT NULL AND deleted_at IS NULL", }, }, { Name: "chargeusagebased_annotations", Unique: false, Columns: []*schema.Column{ChargeUsageBasedColumns[13]}, Annotation: &entsql.IndexAnnotation{ Types: map[string]string{ "postgres": "GIN", }, }, }, { Name: "chargeusagebased_id", Unique: true, Columns: []*schema.Column{ChargeUsageBasedColumns[0]}, }, { Name: "chargeusagebased_namespace", Unique: false, Columns: []*schema.Column{ChargeUsageBasedColumns[14]}, }, { Name: "chargeusagebased_namespace_id", Unique: true, Columns: []*schema.Column{ChargeUsageBasedColumns[14], ChargeUsageBasedColumns[0]}, }, { Name: "chargeusagebased_tax_code_id", Unique: false, Columns: []*schema.Column{ChargeUsageBasedColumns[34]}, }, }, } // ChargeUsageBasedRunCreditAllocationsColumns holds the columns for the "charge_usage_based_run_credit_allocations" table. ChargeUsageBasedRunCreditAllocationsColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "line_id", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "amount", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "service_period_from", Type: field.TypeTime}, {Name: "service_period_to", Type: field.TypeTime}, {Name: "ledger_transaction_group_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "sort_hint", Type: field.TypeInt}, {Name: "type", Type: field.TypeEnum, Enums: []string{"allocation", "correction"}}, {Name: "namespace", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "annotations", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "corrects_realization_id", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "run_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, } // ChargeUsageBasedRunCreditAllocationsTable holds the schema information for the "charge_usage_based_run_credit_allocations" table. ChargeUsageBasedRunCreditAllocationsTable = &schema.Table{ Name: "charge_usage_based_run_credit_allocations", Columns: ChargeUsageBasedRunCreditAllocationsColumns, PrimaryKey: []*schema.Column{ChargeUsageBasedRunCreditAllocationsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "charge_usage_based_run_credit_allocations_charge_usage_based_run_credit_allocations_allocation", Columns: []*schema.Column{ChargeUsageBasedRunCreditAllocationsColumns[13]}, RefColumns: []*schema.Column{ChargeUsageBasedRunCreditAllocationsColumns[0]}, OnDelete: schema.SetNull, }, { Symbol: "charge_ub_run_credit_alloc_run", Columns: []*schema.Column{ChargeUsageBasedRunCreditAllocationsColumns[14]}, RefColumns: []*schema.Column{ChargeUsageBasedRunsColumns[0]}, OnDelete: schema.Cascade, }, }, Indexes: []*schema.Index{ { Name: "chargeusagebasedruncreditallocations_namespace", Unique: false, Columns: []*schema.Column{ChargeUsageBasedRunCreditAllocationsColumns[8]}, }, { Name: "chargeusagebasedruncreditallocations_id", Unique: true, Columns: []*schema.Column{ChargeUsageBasedRunCreditAllocationsColumns[0]}, }, { Name: "chargeusagebasedruncreditallocations_annotations", Unique: false, Columns: []*schema.Column{ChargeUsageBasedRunCreditAllocationsColumns[12]}, Annotation: &entsql.IndexAnnotation{ Types: map[string]string{ "postgres": "GIN", }, }, }, }, } // ChargeUsageBasedRunDetailedLineColumns holds the columns for the "charge_usage_based_run_detailed_line" table. ChargeUsageBasedRunDetailedLineColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "currency", Type: field.TypeString, SchemaType: map[string]string{"postgres": "varchar(3)"}}, {Name: "tax_config", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "tax_behavior", Type: field.TypeEnum, Nullable: true, Enums: []string{"inclusive", "exclusive"}}, {Name: "service_period_start", Type: field.TypeTime}, {Name: "service_period_end", Type: field.TypeTime}, {Name: "quantity", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "invoicing_app_external_id", Type: field.TypeString, Nullable: true}, {Name: "child_unique_reference_id", Type: field.TypeString}, {Name: "per_unit_amount", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "category", Type: field.TypeEnum, Enums: []string{"regular", "commitment"}, Default: "regular"}, {Name: "payment_term", Type: field.TypeEnum, Enums: []string{"in_advance", "in_arrears"}, Default: "in_advance"}, {Name: "index", Type: field.TypeInt, Nullable: true}, {Name: "credits_applied", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "annotations", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "namespace", Type: field.TypeString}, {Name: "metadata", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "name", Type: field.TypeString}, {Name: "description", Type: field.TypeString, Nullable: true}, {Name: "amount", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "taxes_total", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "taxes_inclusive_total", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "taxes_exclusive_total", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "charges_total", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "discounts_total", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "credits_total", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "total", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "pricer_reference_id", Type: field.TypeString}, {Name: "charge_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "run_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "corrects_run_id", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "tax_code_id", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, } // ChargeUsageBasedRunDetailedLineTable holds the schema information for the "charge_usage_based_run_detailed_line" table. ChargeUsageBasedRunDetailedLineTable = &schema.Table{ Name: "charge_usage_based_run_detailed_line", Columns: ChargeUsageBasedRunDetailedLineColumns, PrimaryKey: []*schema.Column{ChargeUsageBasedRunDetailedLineColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "charge_usage_based_run_detailed_line_charge_usage_based_detailed_lines", Columns: []*schema.Column{ChargeUsageBasedRunDetailedLineColumns[31]}, RefColumns: []*schema.Column{ChargeUsageBasedColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "charge_usage_based_run_detailed_line_charge_usage_based_runs_detailed_lines", Columns: []*schema.Column{ChargeUsageBasedRunDetailedLineColumns[32]}, RefColumns: []*schema.Column{ChargeUsageBasedRunsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "cub_run_corrected_detailed_lines", Columns: []*schema.Column{ChargeUsageBasedRunDetailedLineColumns[33]}, RefColumns: []*schema.Column{ChargeUsageBasedRunsColumns[0]}, OnDelete: schema.SetNull, }, { Symbol: "charge_usage_based_run_detailed_line_tax_codes_charge_usage_based_run_detailed_lines", Columns: []*schema.Column{ChargeUsageBasedRunDetailedLineColumns[34]}, RefColumns: []*schema.Column{TaxCodesColumns[0]}, OnDelete: schema.SetNull, }, }, Indexes: []*schema.Index{ { Name: "chargeusagebasedrundetailedline_tax_code_id", Unique: false, Columns: []*schema.Column{ChargeUsageBasedRunDetailedLineColumns[34]}, }, { Name: "chargeusagebasedrundetailedline_annotations", Unique: false, Columns: []*schema.Column{ChargeUsageBasedRunDetailedLineColumns[14]}, Annotation: &entsql.IndexAnnotation{ Types: map[string]string{ "postgres": "GIN", }, }, }, { Name: "chargeusagebasedrundetailedline_id", Unique: true, Columns: []*schema.Column{ChargeUsageBasedRunDetailedLineColumns[0]}, }, { Name: "chargeusagebasedrundetailedline_namespace", Unique: false, Columns: []*schema.Column{ChargeUsageBasedRunDetailedLineColumns[15]}, }, { Name: "chargeusagebasedrundetailedline_namespace_id", Unique: true, Columns: []*schema.Column{ChargeUsageBasedRunDetailedLineColumns[15], ChargeUsageBasedRunDetailedLineColumns[0]}, }, { Name: "chargeusagebasedrundetailedline_namespace_charge_id", Unique: false, Columns: []*schema.Column{ChargeUsageBasedRunDetailedLineColumns[15], ChargeUsageBasedRunDetailedLineColumns[31]}, }, { Name: "chargeusagebasedrundetailedline_namespace_run_id", Unique: false, Columns: []*schema.Column{ChargeUsageBasedRunDetailedLineColumns[15], ChargeUsageBasedRunDetailedLineColumns[32]}, }, { Name: "chargeubdetailedline_ns_charge_run_child_id", Unique: true, Columns: []*schema.Column{ChargeUsageBasedRunDetailedLineColumns[15], ChargeUsageBasedRunDetailedLineColumns[31], ChargeUsageBasedRunDetailedLineColumns[32], ChargeUsageBasedRunDetailedLineColumns[8]}, Annotation: &entsql.IndexAnnotation{ Where: "deleted_at IS NULL", }, }, }, } // ChargeUsageBasedRunInvoicedUsagesColumns holds the columns for the "charge_usage_based_run_invoiced_usages" table. ChargeUsageBasedRunInvoicedUsagesColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "service_period_from", Type: field.TypeTime}, {Name: "service_period_to", Type: field.TypeTime}, {Name: "ledger_transaction_group_id", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "namespace", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "annotations", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "amount", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "taxes_total", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "taxes_inclusive_total", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "taxes_exclusive_total", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "charges_total", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "discounts_total", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "credits_total", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "total", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "run_id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, } // ChargeUsageBasedRunInvoicedUsagesTable holds the schema information for the "charge_usage_based_run_invoiced_usages" table. ChargeUsageBasedRunInvoicedUsagesTable = &schema.Table{ Name: "charge_usage_based_run_invoiced_usages", Columns: ChargeUsageBasedRunInvoicedUsagesColumns, PrimaryKey: []*schema.Column{ChargeUsageBasedRunInvoicedUsagesColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "charge_usage_based_run_invoiced_usages_charge_usage_based_runs_invoiced_usage", Columns: []*schema.Column{ChargeUsageBasedRunInvoicedUsagesColumns[17]}, RefColumns: []*schema.Column{ChargeUsageBasedRunsColumns[0]}, OnDelete: schema.Cascade, }, }, Indexes: []*schema.Index{ { Name: "chargeusagebasedruninvoicedusage_namespace", Unique: false, Columns: []*schema.Column{ChargeUsageBasedRunInvoicedUsagesColumns[4]}, }, { Name: "chargeusagebasedruninvoicedusage_id", Unique: true, Columns: []*schema.Column{ChargeUsageBasedRunInvoicedUsagesColumns[0]}, }, { Name: "chargeusagebasedruninvoicedusage_annotations", Unique: false, Columns: []*schema.Column{ChargeUsageBasedRunInvoicedUsagesColumns[8]}, Annotation: &entsql.IndexAnnotation{ Types: map[string]string{ "postgres": "GIN", }, }, }, }, } // ChargeUsageBasedRunPaymentsColumns holds the columns for the "charge_usage_based_run_payments" table. ChargeUsageBasedRunPaymentsColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "line_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "invoice_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "service_period_from", Type: field.TypeTime}, {Name: "service_period_to", Type: field.TypeTime}, {Name: "status", Type: field.TypeEnum, Enums: []string{"authorized", "settled"}}, {Name: "amount", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "authorized_transaction_group_id", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "authorized_at", Type: field.TypeTime, Nullable: true}, {Name: "settled_transaction_group_id", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "settled_at", Type: field.TypeTime, Nullable: true}, {Name: "namespace", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "annotations", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "run_id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, } // ChargeUsageBasedRunPaymentsTable holds the schema information for the "charge_usage_based_run_payments" table. ChargeUsageBasedRunPaymentsTable = &schema.Table{ Name: "charge_usage_based_run_payments", Columns: ChargeUsageBasedRunPaymentsColumns, PrimaryKey: []*schema.Column{ChargeUsageBasedRunPaymentsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "charge_usage_based_run_payments_charge_usage_based_runs_payment", Columns: []*schema.Column{ChargeUsageBasedRunPaymentsColumns[16]}, RefColumns: []*schema.Column{ChargeUsageBasedRunsColumns[0]}, OnDelete: schema.Cascade, }, }, Indexes: []*schema.Index{ { Name: "chargeusagebasedrunpayment_namespace", Unique: false, Columns: []*schema.Column{ChargeUsageBasedRunPaymentsColumns[11]}, }, { Name: "chargeusagebasedrunpayment_id", Unique: true, Columns: []*schema.Column{ChargeUsageBasedRunPaymentsColumns[0]}, }, { Name: "chargeusagebasedrunpayment_annotations", Unique: false, Columns: []*schema.Column{ChargeUsageBasedRunPaymentsColumns[15]}, Annotation: &entsql.IndexAnnotation{ Types: map[string]string{ "postgres": "GIN", }, }, }, }, } // ChargeUsageBasedRunsColumns holds the columns for the "charge_usage_based_runs" table. ChargeUsageBasedRunsColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "namespace", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "amount", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "taxes_total", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "taxes_inclusive_total", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "taxes_exclusive_total", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "charges_total", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "discounts_total", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "credits_total", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "total", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "type", Type: field.TypeEnum, Enums: []string{"final_realization", "partial_invoice", "invalid_due_to_unsupported_credit_note"}}, {Name: "initial_type", Type: field.TypeEnum, Enums: []string{"final_realization", "partial_invoice", "invalid_due_to_unsupported_credit_note"}}, {Name: "stored_at_lt", Type: field.TypeTime}, {Name: "service_period_to", Type: field.TypeTime}, {Name: "detailed_lines_present", Type: field.TypeBool}, {Name: "metered_quantity", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "no_fiat_transaction_required", Type: field.TypeBool}, {Name: "invoice_id", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "line_id", Type: field.TypeString, Unique: true, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "charge_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "feature_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, } // ChargeUsageBasedRunsTable holds the schema information for the "charge_usage_based_runs" table. ChargeUsageBasedRunsTable = &schema.Table{ Name: "charge_usage_based_runs", Columns: ChargeUsageBasedRunsColumns, PrimaryKey: []*schema.Column{ChargeUsageBasedRunsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "charge_usage_based_runs_billing_invoices_charge_usage_based_runs", Columns: []*schema.Column{ChargeUsageBasedRunsColumns[20]}, RefColumns: []*schema.Column{BillingInvoicesColumns[0]}, OnDelete: schema.SetNull, }, { Symbol: "charge_usage_based_runs_billing_invoice_lines_charge_usage_based_run", Columns: []*schema.Column{ChargeUsageBasedRunsColumns[21]}, RefColumns: []*schema.Column{BillingInvoiceLinesColumns[0]}, OnDelete: schema.SetNull, }, { Symbol: "charge_usage_based_runs_charge_usage_based_runs", Columns: []*schema.Column{ChargeUsageBasedRunsColumns[22]}, RefColumns: []*schema.Column{ChargeUsageBasedColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "charge_usage_based_runs_features_usage_based_runs", Columns: []*schema.Column{ChargeUsageBasedRunsColumns[23]}, RefColumns: []*schema.Column{FeaturesColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "chargeusagebasedruns_namespace", Unique: false, Columns: []*schema.Column{ChargeUsageBasedRunsColumns[1]}, }, { Name: "chargeusagebasedruns_id", Unique: true, Columns: []*schema.Column{ChargeUsageBasedRunsColumns[0]}, }, { Name: "chargeusagebasedruns_namespace_charge_id", Unique: false, Columns: []*schema.Column{ChargeUsageBasedRunsColumns[1], ChargeUsageBasedRunsColumns[22]}, }, }, } // CreditRealizationLineagesColumns holds the columns for the "credit_realization_lineages" table. CreditRealizationLineagesColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "namespace", Type: field.TypeString}, {Name: "root_realization_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "customer_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "currency", Type: field.TypeString, SchemaType: map[string]string{"postgres": "varchar(3)"}}, {Name: "origin_kind", Type: field.TypeEnum, Enums: []string{"real_credit", "advance"}}, {Name: "created_at", Type: field.TypeTime}, {Name: "charge_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, } // CreditRealizationLineagesTable holds the schema information for the "credit_realization_lineages" table. CreditRealizationLineagesTable = &schema.Table{ Name: "credit_realization_lineages", Columns: CreditRealizationLineagesColumns, PrimaryKey: []*schema.Column{CreditRealizationLineagesColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "credit_realization_lineages_charges_credit_realization_lineages", Columns: []*schema.Column{CreditRealizationLineagesColumns[7]}, RefColumns: []*schema.Column{ChargesColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "creditrealizationlineage_id", Unique: true, Columns: []*schema.Column{CreditRealizationLineagesColumns[0]}, }, { Name: "creditrealizationlineage_namespace", Unique: false, Columns: []*schema.Column{CreditRealizationLineagesColumns[1]}, }, { Name: "creditrealizationlineage_namespace_root_realization_id", Unique: true, Columns: []*schema.Column{CreditRealizationLineagesColumns[1], CreditRealizationLineagesColumns[2]}, }, { Name: "creditrealizationlineage_namespace_charge_id", Unique: false, Columns: []*schema.Column{CreditRealizationLineagesColumns[1], CreditRealizationLineagesColumns[7]}, }, { Name: "creditrealizationlineage_namespace_customer_id", Unique: false, Columns: []*schema.Column{CreditRealizationLineagesColumns[1], CreditRealizationLineagesColumns[3]}, }, }, } // CreditRealizationLineageSegmentsColumns holds the columns for the "credit_realization_lineage_segments" table. CreditRealizationLineageSegmentsColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "amount", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "state", Type: field.TypeEnum, Enums: []string{"real_credit", "advance_uncovered", "advance_backfilled", "earnings_recognized"}}, {Name: "backing_transaction_group_id", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "source_state", Type: field.TypeEnum, Nullable: true, Enums: []string{"real_credit", "advance_uncovered", "advance_backfilled", "earnings_recognized"}}, {Name: "source_backing_transaction_group_id", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "closed_at", Type: field.TypeTime, Nullable: true}, {Name: "created_at", Type: field.TypeTime}, {Name: "lineage_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, } // CreditRealizationLineageSegmentsTable holds the schema information for the "credit_realization_lineage_segments" table. CreditRealizationLineageSegmentsTable = &schema.Table{ Name: "credit_realization_lineage_segments", Columns: CreditRealizationLineageSegmentsColumns, PrimaryKey: []*schema.Column{CreditRealizationLineageSegmentsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "credit_realization_lineage_segments_credit_realization_lineages_segments", Columns: []*schema.Column{CreditRealizationLineageSegmentsColumns[8]}, RefColumns: []*schema.Column{CreditRealizationLineagesColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "creditrealizationlineagesegment_id", Unique: true, Columns: []*schema.Column{CreditRealizationLineageSegmentsColumns[0]}, }, { Name: "creditrealizationlineagesegment_lineage_id", Unique: false, Columns: []*schema.Column{CreditRealizationLineageSegmentsColumns[8]}, }, { Name: "creditrealizationlineagesegment_lineage_id_closed_at", Unique: false, Columns: []*schema.Column{CreditRealizationLineageSegmentsColumns[8], CreditRealizationLineageSegmentsColumns[6]}, }, }, } // CurrencyCostBasesColumns holds the columns for the "currency_cost_bases" table. CurrencyCostBasesColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "namespace", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "fiat_code", Type: field.TypeString}, {Name: "rate", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "effective_from", Type: field.TypeTime}, {Name: "custom_currency_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, } // CurrencyCostBasesTable holds the schema information for the "currency_cost_bases" table. CurrencyCostBasesTable = &schema.Table{ Name: "currency_cost_bases", Columns: CurrencyCostBasesColumns, PrimaryKey: []*schema.Column{CurrencyCostBasesColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "currency_cost_bases_custom_currencies_cost_basis_history", Columns: []*schema.Column{CurrencyCostBasesColumns[8]}, RefColumns: []*schema.Column{CustomCurrenciesColumns[0]}, OnDelete: schema.Cascade, }, }, Indexes: []*schema.Index{ { Name: "currencycostbasis_namespace", Unique: false, Columns: []*schema.Column{CurrencyCostBasesColumns[1]}, }, { Name: "currencycostbasis_id", Unique: true, Columns: []*schema.Column{CurrencyCostBasesColumns[0]}, }, { Name: "currencycostbasis_namespace_custom_currency_id_fiat_code_effective_from", Unique: true, Columns: []*schema.Column{CurrencyCostBasesColumns[1], CurrencyCostBasesColumns[8], CurrencyCostBasesColumns[5], CurrencyCostBasesColumns[7]}, Annotation: &entsql.IndexAnnotation{ Where: "deleted_at IS NULL", }, }, }, } // CustomCurrenciesColumns holds the columns for the "custom_currencies" table. CustomCurrenciesColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "namespace", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "code", Type: field.TypeString, Size: 24}, {Name: "name", Type: field.TypeString}, {Name: "symbol", Type: field.TypeString}, } // CustomCurrenciesTable holds the schema information for the "custom_currencies" table. CustomCurrenciesTable = &schema.Table{ Name: "custom_currencies", Columns: CustomCurrenciesColumns, PrimaryKey: []*schema.Column{CustomCurrenciesColumns[0]}, Indexes: []*schema.Index{ { Name: "customcurrency_namespace", Unique: false, Columns: []*schema.Column{CustomCurrenciesColumns[1]}, }, { Name: "customcurrency_id", Unique: true, Columns: []*schema.Column{CustomCurrenciesColumns[0]}, }, { Name: "customcurrency_namespace_code", Unique: true, Columns: []*schema.Column{CustomCurrenciesColumns[1], CustomCurrenciesColumns[5]}, Annotation: &entsql.IndexAnnotation{ Where: "deleted_at IS NULL", }, }, { Name: "customcurrency_namespace_id", Unique: true, Columns: []*schema.Column{CustomCurrenciesColumns[1], CustomCurrenciesColumns[0]}, }, }, } // CustomersColumns holds the columns for the "customers" table. CustomersColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "namespace", Type: field.TypeString}, {Name: "metadata", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "name", Type: field.TypeString}, {Name: "description", Type: field.TypeString, Nullable: true}, {Name: "billing_address_country", Type: field.TypeString, Nullable: true, Size: 2}, {Name: "billing_address_postal_code", Type: field.TypeString, Nullable: true}, {Name: "billing_address_state", Type: field.TypeString, Nullable: true}, {Name: "billing_address_city", Type: field.TypeString, Nullable: true}, {Name: "billing_address_line1", Type: field.TypeString, Nullable: true}, {Name: "billing_address_line2", Type: field.TypeString, Nullable: true}, {Name: "billing_address_phone_number", Type: field.TypeString, Nullable: true}, {Name: "annotations", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "key", Type: field.TypeString, Nullable: true}, {Name: "primary_email", Type: field.TypeString, Nullable: true}, {Name: "currency", Type: field.TypeString, Nullable: true, Size: 3}, } // CustomersTable holds the schema information for the "customers" table. CustomersTable = &schema.Table{ Name: "customers", Columns: CustomersColumns, PrimaryKey: []*schema.Column{CustomersColumns[0]}, Indexes: []*schema.Index{ { Name: "customer_id", Unique: true, Columns: []*schema.Column{CustomersColumns[0]}, }, { Name: "customer_namespace", Unique: false, Columns: []*schema.Column{CustomersColumns[1]}, }, { Name: "customer_namespace_id", Unique: true, Columns: []*schema.Column{CustomersColumns[1], CustomersColumns[0]}, }, { Name: "customer_annotations", Unique: false, Columns: []*schema.Column{CustomersColumns[15]}, Annotation: &entsql.IndexAnnotation{ Types: map[string]string{ "postgres": "GIN", }, }, }, { Name: "customer_namespace_key", Unique: true, Columns: []*schema.Column{CustomersColumns[1], CustomersColumns[16]}, Annotation: &entsql.IndexAnnotation{ Where: "deleted_at IS NULL", }, }, { Name: "customer_namespace_key_deleted_at", Unique: false, Columns: []*schema.Column{CustomersColumns[1], CustomersColumns[16], CustomersColumns[5]}, }, { Name: "customer_name", Unique: false, Columns: []*schema.Column{CustomersColumns[6]}, }, { Name: "customer_primary_email", Unique: false, Columns: []*schema.Column{CustomersColumns[17]}, }, { Name: "customer_created_at", Unique: false, Columns: []*schema.Column{CustomersColumns[3]}, }, }, } // CustomerSubjectsColumns holds the columns for the "customer_subjects" table. CustomerSubjectsColumns = []*schema.Column{ {Name: "id", Type: field.TypeInt, Increment: true}, {Name: "namespace", Type: field.TypeString}, {Name: "subject_key", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "customer_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, } // CustomerSubjectsTable holds the schema information for the "customer_subjects" table. CustomerSubjectsTable = &schema.Table{ Name: "customer_subjects", Columns: CustomerSubjectsColumns, PrimaryKey: []*schema.Column{CustomerSubjectsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "customer_subjects_customers_subjects", Columns: []*schema.Column{CustomerSubjectsColumns[5]}, RefColumns: []*schema.Column{CustomersColumns[0]}, OnDelete: schema.Cascade, }, }, Indexes: []*schema.Index{ { Name: "customersubjects_namespace", Unique: false, Columns: []*schema.Column{CustomerSubjectsColumns[1]}, }, { Name: "customersubjects_namespace_customer_id_deleted_at", Unique: false, Columns: []*schema.Column{CustomerSubjectsColumns[1], CustomerSubjectsColumns[5], CustomerSubjectsColumns[4]}, }, { Name: "customersubjects_namespace_subject_key", Unique: true, Columns: []*schema.Column{CustomerSubjectsColumns[1], CustomerSubjectsColumns[2]}, Annotation: &entsql.IndexAnnotation{ Where: "deleted_at IS NULL", }, }, { Name: "customersubjects_deleted_at", Unique: false, Columns: []*schema.Column{CustomerSubjectsColumns[4]}, }, { Name: "customersubjects_subject_key", Unique: false, Columns: []*schema.Column{CustomerSubjectsColumns[2]}, }, { Name: "customersubjects_customer_id", Unique: false, Columns: []*schema.Column{CustomerSubjectsColumns[5]}, }, { Name: "customersubjects_deleted_at_customer_id", Unique: false, Columns: []*schema.Column{CustomerSubjectsColumns[4], CustomerSubjectsColumns[5]}, }, }, } // EntitlementsColumns holds the columns for the "entitlements" table. EntitlementsColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "namespace", Type: field.TypeString}, {Name: "metadata", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "entitlement_type", Type: field.TypeEnum, Enums: []string{"metered", "static", "boolean"}}, {Name: "active_from", Type: field.TypeTime, Nullable: true}, {Name: "active_to", Type: field.TypeTime, Nullable: true}, {Name: "feature_key", Type: field.TypeString}, {Name: "measure_usage_from", Type: field.TypeTime, Nullable: true}, {Name: "issue_after_reset", Type: field.TypeFloat64, Nullable: true}, {Name: "issue_after_reset_priority", Type: field.TypeUint8, Nullable: true}, {Name: "is_soft_limit", Type: field.TypeBool, Nullable: true}, {Name: "preserve_overage_at_reset", Type: field.TypeBool, Nullable: true}, {Name: "config", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "usage_period_interval", Type: field.TypeString, Nullable: true}, {Name: "usage_period_anchor", Type: field.TypeTime, Nullable: true}, {Name: "current_usage_period_start", Type: field.TypeTime, Nullable: true}, {Name: "current_usage_period_end", Type: field.TypeTime, Nullable: true}, {Name: "annotations", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "customer_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "feature_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, } // EntitlementsTable holds the schema information for the "entitlements" table. EntitlementsTable = &schema.Table{ Name: "entitlements", Columns: EntitlementsColumns, PrimaryKey: []*schema.Column{EntitlementsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "entitlements_customers_entitlements", Columns: []*schema.Column{EntitlementsColumns[21]}, RefColumns: []*schema.Column{CustomersColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "entitlements_features_entitlement", Columns: []*schema.Column{EntitlementsColumns[22]}, RefColumns: []*schema.Column{FeaturesColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "entitlement_id", Unique: true, Columns: []*schema.Column{EntitlementsColumns[0]}, }, { Name: "entitlement_namespace", Unique: false, Columns: []*schema.Column{EntitlementsColumns[1]}, }, { Name: "entitlement_namespace_id", Unique: false, Columns: []*schema.Column{EntitlementsColumns[1], EntitlementsColumns[0]}, }, { Name: "entitlement_namespace_customer_id", Unique: false, Columns: []*schema.Column{EntitlementsColumns[1], EntitlementsColumns[21]}, }, { Name: "entitlement_namespace_id_customer_id", Unique: false, Columns: []*schema.Column{EntitlementsColumns[1], EntitlementsColumns[0], EntitlementsColumns[21]}, }, { Name: "entitlement_namespace_feature_id_id", Unique: false, Columns: []*schema.Column{EntitlementsColumns[1], EntitlementsColumns[22], EntitlementsColumns[0]}, }, { Name: "entitlement_namespace_current_usage_period_end", Unique: false, Columns: []*schema.Column{EntitlementsColumns[1], EntitlementsColumns[19]}, }, { Name: "entitlement_current_usage_period_end_deleted_at", Unique: false, Columns: []*schema.Column{EntitlementsColumns[19], EntitlementsColumns[5]}, }, { Name: "entitlement_created_at_id", Unique: true, Columns: []*schema.Column{EntitlementsColumns[3], EntitlementsColumns[0]}, }, }, } // FeaturesColumns holds the columns for the "features" table. FeaturesColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "metadata", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "namespace", Type: field.TypeString}, {Name: "name", Type: field.TypeString}, {Name: "description", Type: field.TypeString, Nullable: true, Size: 1024}, {Name: "key", Type: field.TypeString}, {Name: "meter_slug", Type: field.TypeString, Nullable: true}, {Name: "meter_group_by_filters", Type: field.TypeJSON, Nullable: true}, {Name: "advanced_meter_group_by_filters", Type: field.TypeJSON, Nullable: true}, {Name: "unit_cost_type", Type: field.TypeString, Nullable: true}, {Name: "unit_cost_manual_amount", Type: field.TypeOther, Nullable: true, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "unit_cost_llm_provider_property", Type: field.TypeString, Nullable: true}, {Name: "unit_cost_llm_provider", Type: field.TypeString, Nullable: true}, {Name: "unit_cost_llm_model_property", Type: field.TypeString, Nullable: true}, {Name: "unit_cost_llm_model", Type: field.TypeString, Nullable: true}, {Name: "unit_cost_llm_token_type_property", Type: field.TypeString, Nullable: true}, {Name: "unit_cost_llm_token_type", Type: field.TypeString, Nullable: true}, {Name: "archived_at", Type: field.TypeTime, Nullable: true}, {Name: "meter_id", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, } // FeaturesTable holds the schema information for the "features" table. FeaturesTable = &schema.Table{ Name: "features", Columns: FeaturesColumns, PrimaryKey: []*schema.Column{FeaturesColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "features_meters_feature", Columns: []*schema.Column{FeaturesColumns[21]}, RefColumns: []*schema.Column{MetersColumns[0]}, OnDelete: schema.SetNull, }, }, Indexes: []*schema.Index{ { Name: "feature_id", Unique: true, Columns: []*schema.Column{FeaturesColumns[0]}, }, { Name: "feature_namespace_id", Unique: false, Columns: []*schema.Column{FeaturesColumns[5], FeaturesColumns[0]}, }, { Name: "feature_namespace_key", Unique: true, Columns: []*schema.Column{FeaturesColumns[5], FeaturesColumns[8]}, Annotation: &entsql.IndexAnnotation{ Where: "archived_at IS NULL", }, }, { Name: "feature_namespace_meter_slug", Unique: false, Columns: []*schema.Column{FeaturesColumns[5], FeaturesColumns[9]}, Annotation: &entsql.IndexAnnotation{ Where: "archived_at IS NULL", }, }, { Name: "feature_namespace_meter_id", Unique: false, Columns: []*schema.Column{FeaturesColumns[5], FeaturesColumns[21]}, Annotation: &entsql.IndexAnnotation{ Where: "archived_at IS NULL", }, }, }, } // GrantsColumns holds the columns for the "grants" table. GrantsColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "namespace", Type: field.TypeString}, {Name: "annotations", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "metadata", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "amount", Type: field.TypeFloat64, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "priority", Type: field.TypeUint8, Default: 0}, {Name: "effective_at", Type: field.TypeTime}, {Name: "expiration", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "expires_at", Type: field.TypeTime, Nullable: true}, {Name: "voided_at", Type: field.TypeTime, Nullable: true}, {Name: "reset_max_rollover", Type: field.TypeFloat64, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "reset_min_rollover", Type: field.TypeFloat64, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "recurrence_period", Type: field.TypeString, Nullable: true}, {Name: "recurrence_anchor", Type: field.TypeTime, Nullable: true}, {Name: "owner_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, } // GrantsTable holds the schema information for the "grants" table. GrantsTable = &schema.Table{ Name: "grants", Columns: GrantsColumns, PrimaryKey: []*schema.Column{GrantsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "grants_entitlements_grant", Columns: []*schema.Column{GrantsColumns[17]}, RefColumns: []*schema.Column{EntitlementsColumns[0]}, OnDelete: schema.Cascade, }, }, Indexes: []*schema.Index{ { Name: "grant_id", Unique: true, Columns: []*schema.Column{GrantsColumns[0]}, }, { Name: "grant_namespace", Unique: false, Columns: []*schema.Column{GrantsColumns[1]}, }, { Name: "grant_annotations", Unique: false, Columns: []*schema.Column{GrantsColumns[2]}, Annotation: &entsql.IndexAnnotation{ Types: map[string]string{ "postgres": "GIN", }, }, }, { Name: "grant_namespace_owner_id", Unique: false, Columns: []*schema.Column{GrantsColumns[1], GrantsColumns[17]}, }, { Name: "grant_effective_at_expires_at", Unique: false, Columns: []*schema.Column{GrantsColumns[9], GrantsColumns[11]}, }, }, } // LlmCostPricesColumns holds the columns for the "llm_cost_prices" table. LlmCostPricesColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "metadata", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "namespace", Type: field.TypeString, Nullable: true}, {Name: "provider", Type: field.TypeString}, {Name: "model_id", Type: field.TypeString}, {Name: "model_name", Type: field.TypeString, Default: ""}, {Name: "input_per_token", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "output_per_token", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "cache_read_per_token", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "reasoning_per_token", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "cache_write_per_token", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "currency", Type: field.TypeString, Default: "USD"}, {Name: "source", Type: field.TypeString}, {Name: "source_prices", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "effective_from", Type: field.TypeTime}, {Name: "effective_to", Type: field.TypeTime, Nullable: true}, } // LlmCostPricesTable holds the schema information for the "llm_cost_prices" table. LlmCostPricesTable = &schema.Table{ Name: "llm_cost_prices", Columns: LlmCostPricesColumns, PrimaryKey: []*schema.Column{LlmCostPricesColumns[0]}, Indexes: []*schema.Index{ { Name: "llmcostprice_id", Unique: true, Columns: []*schema.Column{LlmCostPricesColumns[0]}, }, { Name: "llmcostprice_provider_model_id_namespace_effective_from", Unique: true, Columns: []*schema.Column{LlmCostPricesColumns[6], LlmCostPricesColumns[7], LlmCostPricesColumns[5], LlmCostPricesColumns[17]}, Annotation: &entsql.IndexAnnotation{ Where: "deleted_at IS NULL", }, }, { Name: "llmcostprice_namespace_provider_model_id", Unique: false, Columns: []*schema.Column{LlmCostPricesColumns[5], LlmCostPricesColumns[6], LlmCostPricesColumns[7]}, Annotation: &entsql.IndexAnnotation{ Where: "deleted_at IS NULL", }, }, { Name: "llmcostprice_provider_model_id", Unique: false, Columns: []*schema.Column{LlmCostPricesColumns[6], LlmCostPricesColumns[7]}, Annotation: &entsql.IndexAnnotation{ Where: "deleted_at IS NULL AND namespace IS NULL", }, }, }, } // LedgerAccountsColumns holds the columns for the "ledger_accounts" table. LedgerAccountsColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "namespace", Type: field.TypeString}, {Name: "annotations", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "account_type", Type: field.TypeString}, } // LedgerAccountsTable holds the schema information for the "ledger_accounts" table. LedgerAccountsTable = &schema.Table{ Name: "ledger_accounts", Columns: LedgerAccountsColumns, PrimaryKey: []*schema.Column{LedgerAccountsColumns[0]}, Indexes: []*schema.Index{ { Name: "ledgeraccount_id", Unique: true, Columns: []*schema.Column{LedgerAccountsColumns[0]}, }, { Name: "ledgeraccount_namespace", Unique: false, Columns: []*schema.Column{LedgerAccountsColumns[1]}, }, { Name: "ledgeraccount_annotations", Unique: false, Columns: []*schema.Column{LedgerAccountsColumns[2]}, Annotation: &entsql.IndexAnnotation{ Types: map[string]string{ "postgres": "GIN", }, }, }, { Name: "ledgeraccount_namespace_id", Unique: true, Columns: []*schema.Column{LedgerAccountsColumns[1], LedgerAccountsColumns[0]}, }, }, } // LedgerCustomerAccountsColumns holds the columns for the "ledger_customer_accounts" table. LedgerCustomerAccountsColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "namespace", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "customer_id", Type: field.TypeString}, {Name: "account_type", Type: field.TypeString}, {Name: "account_id", Type: field.TypeString}, } // LedgerCustomerAccountsTable holds the schema information for the "ledger_customer_accounts" table. LedgerCustomerAccountsTable = &schema.Table{ Name: "ledger_customer_accounts", Columns: LedgerCustomerAccountsColumns, PrimaryKey: []*schema.Column{LedgerCustomerAccountsColumns[0]}, Indexes: []*schema.Index{ { Name: "ledgercustomeraccount_id", Unique: true, Columns: []*schema.Column{LedgerCustomerAccountsColumns[0]}, }, { Name: "ledgercustomeraccount_namespace", Unique: false, Columns: []*schema.Column{LedgerCustomerAccountsColumns[1]}, }, { Name: "ledgercustomeraccount_namespace_id", Unique: true, Columns: []*schema.Column{LedgerCustomerAccountsColumns[1], LedgerCustomerAccountsColumns[0]}, }, { Name: "ledgercustomeraccount_namespace_customer_id_account_type", Unique: true, Columns: []*schema.Column{LedgerCustomerAccountsColumns[1], LedgerCustomerAccountsColumns[5], LedgerCustomerAccountsColumns[6]}, }, }, } // LedgerEntriesColumns holds the columns for the "ledger_entries" table. LedgerEntriesColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "namespace", Type: field.TypeString}, {Name: "annotations", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "amount", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "sub_account_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "transaction_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, } // LedgerEntriesTable holds the schema information for the "ledger_entries" table. LedgerEntriesTable = &schema.Table{ Name: "ledger_entries", Columns: LedgerEntriesColumns, PrimaryKey: []*schema.Column{LedgerEntriesColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "ledger_entries_ledger_sub_accounts_entries", Columns: []*schema.Column{LedgerEntriesColumns[7]}, RefColumns: []*schema.Column{LedgerSubAccountsColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "ledger_entries_ledger_transactions_entries", Columns: []*schema.Column{LedgerEntriesColumns[8]}, RefColumns: []*schema.Column{LedgerTransactionsColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "ledgerentry_id", Unique: true, Columns: []*schema.Column{LedgerEntriesColumns[0]}, }, { Name: "ledgerentry_namespace", Unique: false, Columns: []*schema.Column{LedgerEntriesColumns[1]}, }, { Name: "ledgerentry_annotations", Unique: false, Columns: []*schema.Column{LedgerEntriesColumns[2]}, Annotation: &entsql.IndexAnnotation{ Types: map[string]string{ "postgres": "GIN", }, }, }, { Name: "ledgerentry_namespace_id", Unique: true, Columns: []*schema.Column{LedgerEntriesColumns[1], LedgerEntriesColumns[0]}, }, { Name: "ledgerentry_namespace_transaction_id", Unique: false, Columns: []*schema.Column{LedgerEntriesColumns[1], LedgerEntriesColumns[8]}, }, { Name: "ledgerentry_namespace_sub_account_id", Unique: false, Columns: []*schema.Column{LedgerEntriesColumns[1], LedgerEntriesColumns[7]}, }, { Name: "ledgerentry_created_at_id", Unique: false, Columns: []*schema.Column{LedgerEntriesColumns[3], LedgerEntriesColumns[0]}, Annotation: &entsql.IndexAnnotation{ Where: "deleted_at IS NULL", }, }, }, } // LedgerSubAccountsColumns holds the columns for the "ledger_sub_accounts" table. LedgerSubAccountsColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "namespace", Type: field.TypeString}, {Name: "annotations", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "account_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "route_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, } // LedgerSubAccountsTable holds the schema information for the "ledger_sub_accounts" table. LedgerSubAccountsTable = &schema.Table{ Name: "ledger_sub_accounts", Columns: LedgerSubAccountsColumns, PrimaryKey: []*schema.Column{LedgerSubAccountsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "ledger_sub_accounts_ledger_accounts_sub_accounts", Columns: []*schema.Column{LedgerSubAccountsColumns[6]}, RefColumns: []*schema.Column{LedgerAccountsColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "ledger_sub_accounts_ledger_sub_account_routes_sub_accounts", Columns: []*schema.Column{LedgerSubAccountsColumns[7]}, RefColumns: []*schema.Column{LedgerSubAccountRoutesColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "ledgersubaccount_id", Unique: true, Columns: []*schema.Column{LedgerSubAccountsColumns[0]}, }, { Name: "ledgersubaccount_namespace", Unique: false, Columns: []*schema.Column{LedgerSubAccountsColumns[1]}, }, { Name: "ledgersubaccount_annotations", Unique: false, Columns: []*schema.Column{LedgerSubAccountsColumns[2]}, Annotation: &entsql.IndexAnnotation{ Types: map[string]string{ "postgres": "GIN", }, }, }, { Name: "ledgersubaccount_namespace_account_id_route_id", Unique: true, Columns: []*schema.Column{LedgerSubAccountsColumns[1], LedgerSubAccountsColumns[6], LedgerSubAccountsColumns[7]}, }, }, } // LedgerSubAccountRoutesColumns holds the columns for the "ledger_sub_account_routes" table. LedgerSubAccountRoutesColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "namespace", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "routing_key_version", Type: field.TypeString}, {Name: "routing_key", Type: field.TypeString}, {Name: "currency", Type: field.TypeString}, {Name: "tax_code", Type: field.TypeString, Nullable: true}, {Name: "features", Type: field.TypeJSON, Nullable: true}, {Name: "cost_basis", Type: field.TypeOther, Nullable: true, SchemaType: map[string]string{"postgres": "numeric"}}, {Name: "credit_priority", Type: field.TypeInt, Nullable: true}, {Name: "transaction_authorization_status", Type: field.TypeString, Nullable: true}, {Name: "account_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, } // LedgerSubAccountRoutesTable holds the schema information for the "ledger_sub_account_routes" table. LedgerSubAccountRoutesTable = &schema.Table{ Name: "ledger_sub_account_routes", Columns: LedgerSubAccountRoutesColumns, PrimaryKey: []*schema.Column{LedgerSubAccountRoutesColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "ledger_sub_account_routes_ledger_accounts_sub_account_routes", Columns: []*schema.Column{LedgerSubAccountRoutesColumns[13]}, RefColumns: []*schema.Column{LedgerAccountsColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "ledgersubaccountroute_id", Unique: true, Columns: []*schema.Column{LedgerSubAccountRoutesColumns[0]}, }, { Name: "ledgersubaccountroute_namespace", Unique: false, Columns: []*schema.Column{LedgerSubAccountRoutesColumns[1]}, }, { Name: "ledgersubaccountroute_namespace_account_id_routing_key_version_routing_key", Unique: true, Columns: []*schema.Column{LedgerSubAccountRoutesColumns[1], LedgerSubAccountRoutesColumns[13], LedgerSubAccountRoutesColumns[5], LedgerSubAccountRoutesColumns[6]}, }, }, } // LedgerTransactionsColumns holds the columns for the "ledger_transactions" table. LedgerTransactionsColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "namespace", Type: field.TypeString}, {Name: "annotations", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "booked_at", Type: field.TypeTime}, {Name: "group_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, } // LedgerTransactionsTable holds the schema information for the "ledger_transactions" table. LedgerTransactionsTable = &schema.Table{ Name: "ledger_transactions", Columns: LedgerTransactionsColumns, PrimaryKey: []*schema.Column{LedgerTransactionsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "ledger_transactions_ledger_transaction_groups_transactions", Columns: []*schema.Column{LedgerTransactionsColumns[7]}, RefColumns: []*schema.Column{LedgerTransactionGroupsColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "ledgertransaction_id", Unique: true, Columns: []*schema.Column{LedgerTransactionsColumns[0]}, }, { Name: "ledgertransaction_namespace", Unique: false, Columns: []*schema.Column{LedgerTransactionsColumns[1]}, }, { Name: "ledgertransaction_annotations", Unique: false, Columns: []*schema.Column{LedgerTransactionsColumns[2]}, Annotation: &entsql.IndexAnnotation{ Types: map[string]string{ "postgres": "GIN", }, }, }, { Name: "ledgertransaction_namespace_id", Unique: true, Columns: []*schema.Column{LedgerTransactionsColumns[1], LedgerTransactionsColumns[0]}, }, { Name: "ledgertransaction_namespace_group_id", Unique: false, Columns: []*schema.Column{LedgerTransactionsColumns[1], LedgerTransactionsColumns[7]}, }, { Name: "ledgertransaction_namespace_booked_at", Unique: false, Columns: []*schema.Column{LedgerTransactionsColumns[1], LedgerTransactionsColumns[6]}, }, }, } // LedgerTransactionGroupsColumns holds the columns for the "ledger_transaction_groups" table. LedgerTransactionGroupsColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "namespace", Type: field.TypeString}, {Name: "annotations", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, } // LedgerTransactionGroupsTable holds the schema information for the "ledger_transaction_groups" table. LedgerTransactionGroupsTable = &schema.Table{ Name: "ledger_transaction_groups", Columns: LedgerTransactionGroupsColumns, PrimaryKey: []*schema.Column{LedgerTransactionGroupsColumns[0]}, Indexes: []*schema.Index{ { Name: "ledgertransactiongroup_id", Unique: true, Columns: []*schema.Column{LedgerTransactionGroupsColumns[0]}, }, { Name: "ledgertransactiongroup_namespace", Unique: false, Columns: []*schema.Column{LedgerTransactionGroupsColumns[1]}, }, { Name: "ledgertransactiongroup_annotations", Unique: false, Columns: []*schema.Column{LedgerTransactionGroupsColumns[2]}, Annotation: &entsql.IndexAnnotation{ Types: map[string]string{ "postgres": "GIN", }, }, }, { Name: "ledgertransactiongroup_namespace_id", Unique: true, Columns: []*schema.Column{LedgerTransactionGroupsColumns[1], LedgerTransactionGroupsColumns[0]}, }, }, } // MetersColumns holds the columns for the "meters" table. MetersColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "namespace", Type: field.TypeString}, {Name: "metadata", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "name", Type: field.TypeString}, {Name: "description", Type: field.TypeString, Nullable: true}, {Name: "key", Type: field.TypeString}, {Name: "annotations", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "event_type", Type: field.TypeString}, {Name: "value_property", Type: field.TypeString, Nullable: true}, {Name: "group_by", Type: field.TypeJSON, Nullable: true}, {Name: "aggregation", Type: field.TypeEnum, Enums: []string{"SUM", "COUNT", "AVG", "MIN", "MAX", "UNIQUE_COUNT", "LATEST"}}, {Name: "event_from", Type: field.TypeTime, Nullable: true}, } // MetersTable holds the schema information for the "meters" table. MetersTable = &schema.Table{ Name: "meters", Columns: MetersColumns, PrimaryKey: []*schema.Column{MetersColumns[0]}, Indexes: []*schema.Index{ { Name: "meter_id", Unique: true, Columns: []*schema.Column{MetersColumns[0]}, }, { Name: "meter_namespace", Unique: false, Columns: []*schema.Column{MetersColumns[1]}, }, { Name: "meter_namespace_id", Unique: true, Columns: []*schema.Column{MetersColumns[1], MetersColumns[0]}, }, { Name: "meter_namespace_key_deleted_at", Unique: true, Columns: []*schema.Column{MetersColumns[1], MetersColumns[8], MetersColumns[5]}, }, { Name: "meter_annotations", Unique: false, Columns: []*schema.Column{MetersColumns[9]}, Annotation: &entsql.IndexAnnotation{ Types: map[string]string{ "postgres": "GIN", }, }, }, { Name: "meter_namespace_key", Unique: true, Columns: []*schema.Column{MetersColumns[1], MetersColumns[8]}, Annotation: &entsql.IndexAnnotation{ Where: "deleted_at IS NULL", }, }, { Name: "meter_namespace_event_type", Unique: false, Columns: []*schema.Column{MetersColumns[1], MetersColumns[10]}, }, }, } // NotificationChannelsColumns holds the columns for the "notification_channels" table. NotificationChannelsColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "namespace", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "annotations", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "metadata", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "type", Type: field.TypeEnum, Enums: []string{"WEBHOOK"}}, {Name: "name", Type: field.TypeString}, {Name: "disabled", Type: field.TypeBool, Nullable: true, Default: false}, {Name: "config", Type: field.TypeString, SchemaType: map[string]string{"postgres": "jsonb"}}, } // NotificationChannelsTable holds the schema information for the "notification_channels" table. NotificationChannelsTable = &schema.Table{ Name: "notification_channels", Columns: NotificationChannelsColumns, PrimaryKey: []*schema.Column{NotificationChannelsColumns[0]}, Indexes: []*schema.Index{ { Name: "notificationchannel_id", Unique: true, Columns: []*schema.Column{NotificationChannelsColumns[0]}, }, { Name: "notificationchannel_namespace", Unique: false, Columns: []*schema.Column{NotificationChannelsColumns[1]}, }, { Name: "notificationchannel_annotations", Unique: false, Columns: []*schema.Column{NotificationChannelsColumns[5]}, Annotation: &entsql.IndexAnnotation{ Types: map[string]string{ "postgres": "GIN", }, }, }, { Name: "notificationchannel_namespace_id", Unique: false, Columns: []*schema.Column{NotificationChannelsColumns[1], NotificationChannelsColumns[0]}, }, { Name: "notificationchannel_namespace_type", Unique: false, Columns: []*schema.Column{NotificationChannelsColumns[1], NotificationChannelsColumns[7]}, }, }, } // NotificationEventsColumns holds the columns for the "notification_events" table. NotificationEventsColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "namespace", Type: field.TypeString}, {Name: "annotations", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "created_at", Type: field.TypeTime}, {Name: "type", Type: field.TypeEnum, Enums: []string{"entitlements.balance.threshold", "entitlements.reset", "invoice.created", "invoice.updated"}}, {Name: "payload", Type: field.TypeString, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "rule_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, } // NotificationEventsTable holds the schema information for the "notification_events" table. NotificationEventsTable = &schema.Table{ Name: "notification_events", Columns: NotificationEventsColumns, PrimaryKey: []*schema.Column{NotificationEventsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "notification_events_notification_rules_events", Columns: []*schema.Column{NotificationEventsColumns[6]}, RefColumns: []*schema.Column{NotificationRulesColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "notificationevent_id", Unique: true, Columns: []*schema.Column{NotificationEventsColumns[0]}, }, { Name: "notificationevent_namespace", Unique: false, Columns: []*schema.Column{NotificationEventsColumns[1]}, }, { Name: "notificationevent_annotations", Unique: false, Columns: []*schema.Column{NotificationEventsColumns[2]}, Annotation: &entsql.IndexAnnotation{ Types: map[string]string{ "postgres": "GIN", }, }, }, { Name: "notificationevent_namespace_id", Unique: false, Columns: []*schema.Column{NotificationEventsColumns[1], NotificationEventsColumns[0]}, }, { Name: "notificationevent_namespace_type", Unique: false, Columns: []*schema.Column{NotificationEventsColumns[1], NotificationEventsColumns[4]}, }, }, } // NotificationEventDeliveryStatusColumns holds the columns for the "notification_event_delivery_status" table. NotificationEventDeliveryStatusColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "namespace", Type: field.TypeString}, {Name: "annotations", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "event_id", Type: field.TypeString}, {Name: "channel_id", Type: field.TypeString}, {Name: "state", Type: field.TypeEnum, Enums: []string{"SUCCESS", "FAILED", "SENDING", "PENDING", "RESENDING"}, Default: "PENDING"}, {Name: "reason", Type: field.TypeString, Nullable: true}, {Name: "next_attempt_at", Type: field.TypeTime, Nullable: true}, {Name: "attempts", Type: field.TypeJSON, Nullable: true}, } // NotificationEventDeliveryStatusTable holds the schema information for the "notification_event_delivery_status" table. NotificationEventDeliveryStatusTable = &schema.Table{ Name: "notification_event_delivery_status", Columns: NotificationEventDeliveryStatusColumns, PrimaryKey: []*schema.Column{NotificationEventDeliveryStatusColumns[0]}, Indexes: []*schema.Index{ { Name: "notificationeventdeliverystatus_id", Unique: true, Columns: []*schema.Column{NotificationEventDeliveryStatusColumns[0]}, }, { Name: "notificationeventdeliverystatus_namespace", Unique: false, Columns: []*schema.Column{NotificationEventDeliveryStatusColumns[1]}, }, { Name: "notificationeventdeliverystatus_annotations", Unique: false, Columns: []*schema.Column{NotificationEventDeliveryStatusColumns[2]}, Annotation: &entsql.IndexAnnotation{ Types: map[string]string{ "postgres": "GIN", }, }, }, { Name: "notificationeventdeliverystatus_namespace_id", Unique: false, Columns: []*schema.Column{NotificationEventDeliveryStatusColumns[1], NotificationEventDeliveryStatusColumns[0]}, }, { Name: "notificationeventdeliverystatus_namespace_event_id_channel_id", Unique: false, Columns: []*schema.Column{NotificationEventDeliveryStatusColumns[1], NotificationEventDeliveryStatusColumns[5], NotificationEventDeliveryStatusColumns[6]}, }, { Name: "notificationeventdeliverystatus_namespace_state", Unique: false, Columns: []*schema.Column{NotificationEventDeliveryStatusColumns[1], NotificationEventDeliveryStatusColumns[7]}, }, { Name: "notificationeventdeliverystatus_namespace_state_next_attempt_at", Unique: false, Columns: []*schema.Column{NotificationEventDeliveryStatusColumns[1], NotificationEventDeliveryStatusColumns[7], NotificationEventDeliveryStatusColumns[9]}, }, }, } // NotificationRulesColumns holds the columns for the "notification_rules" table. NotificationRulesColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "namespace", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "annotations", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "metadata", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "type", Type: field.TypeEnum, Enums: []string{"entitlements.balance.threshold", "entitlements.reset", "invoice.created", "invoice.updated"}}, {Name: "name", Type: field.TypeString}, {Name: "disabled", Type: field.TypeBool, Nullable: true, Default: false}, {Name: "config", Type: field.TypeString, SchemaType: map[string]string{"postgres": "jsonb"}}, } // NotificationRulesTable holds the schema information for the "notification_rules" table. NotificationRulesTable = &schema.Table{ Name: "notification_rules", Columns: NotificationRulesColumns, PrimaryKey: []*schema.Column{NotificationRulesColumns[0]}, Indexes: []*schema.Index{ { Name: "notificationrule_id", Unique: true, Columns: []*schema.Column{NotificationRulesColumns[0]}, }, { Name: "notificationrule_namespace", Unique: false, Columns: []*schema.Column{NotificationRulesColumns[1]}, }, { Name: "notificationrule_annotations", Unique: false, Columns: []*schema.Column{NotificationRulesColumns[5]}, Annotation: &entsql.IndexAnnotation{ Types: map[string]string{ "postgres": "GIN", }, }, }, { Name: "notificationrule_namespace_id", Unique: false, Columns: []*schema.Column{NotificationRulesColumns[1], NotificationRulesColumns[0]}, }, { Name: "notificationrule_namespace_type", Unique: false, Columns: []*schema.Column{NotificationRulesColumns[1], NotificationRulesColumns[7]}, }, }, } // OrganizationDefaultTaxCodesColumns holds the columns for the "organization_default_tax_codes" table. OrganizationDefaultTaxCodesColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "namespace", Type: field.TypeString}, {Name: "invoicing_tax_code_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "credit_grant_tax_code_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, } // OrganizationDefaultTaxCodesTable holds the schema information for the "organization_default_tax_codes" table. OrganizationDefaultTaxCodesTable = &schema.Table{ Name: "organization_default_tax_codes", Columns: OrganizationDefaultTaxCodesColumns, PrimaryKey: []*schema.Column{OrganizationDefaultTaxCodesColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "org_dtc_invoicing_tax_code_fk", Columns: []*schema.Column{OrganizationDefaultTaxCodesColumns[5]}, RefColumns: []*schema.Column{TaxCodesColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "org_dtc_credit_grant_tax_code_fk", Columns: []*schema.Column{OrganizationDefaultTaxCodesColumns[6]}, RefColumns: []*schema.Column{TaxCodesColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "organizationdefaulttaxcodes_id", Unique: true, Columns: []*schema.Column{OrganizationDefaultTaxCodesColumns[0]}, }, { Name: "organizationdefaulttaxcodes_namespace", Unique: true, Columns: []*schema.Column{OrganizationDefaultTaxCodesColumns[4]}, Annotation: &entsql.IndexAnnotation{ Where: "deleted_at IS NULL", }, }, }, } // PlansColumns holds the columns for the "plans" table. PlansColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "namespace", Type: field.TypeString}, {Name: "metadata", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "name", Type: field.TypeString}, {Name: "description", Type: field.TypeString, Nullable: true}, {Name: "key", Type: field.TypeString}, {Name: "version", Type: field.TypeInt}, {Name: "currency", Type: field.TypeString, Default: "USD"}, {Name: "billing_cadence", Type: field.TypeString}, {Name: "pro_rating_config", Type: field.TypeString, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "effective_from", Type: field.TypeTime, Nullable: true}, {Name: "effective_to", Type: field.TypeTime, Nullable: true}, {Name: "settlement_mode", Type: field.TypeEnum, Enums: []string{"credit_then_invoice", "credit_only"}, Default: "credit_then_invoice"}, } // PlansTable holds the schema information for the "plans" table. PlansTable = &schema.Table{ Name: "plans", Columns: PlansColumns, PrimaryKey: []*schema.Column{PlansColumns[0]}, Indexes: []*schema.Index{ { Name: "plan_id", Unique: true, Columns: []*schema.Column{PlansColumns[0]}, }, { Name: "plan_namespace", Unique: false, Columns: []*schema.Column{PlansColumns[1]}, }, { Name: "plan_namespace_id", Unique: true, Columns: []*schema.Column{PlansColumns[1], PlansColumns[0]}, }, { Name: "plan_namespace_key_deleted_at", Unique: true, Columns: []*schema.Column{PlansColumns[1], PlansColumns[8], PlansColumns[5]}, }, { Name: "plan_namespace_key_version", Unique: true, Columns: []*schema.Column{PlansColumns[1], PlansColumns[8], PlansColumns[9]}, Annotation: &entsql.IndexAnnotation{ Where: "deleted_at IS NULL", }, }, }, } // PlanAddonsColumns holds the columns for the "plan_addons" table. PlanAddonsColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "namespace", Type: field.TypeString}, {Name: "metadata", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "annotations", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "from_plan_phase", Type: field.TypeString}, {Name: "max_quantity", Type: field.TypeInt, Nullable: true}, {Name: "addon_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "plan_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, } // PlanAddonsTable holds the schema information for the "plan_addons" table. PlanAddonsTable = &schema.Table{ Name: "plan_addons", Columns: PlanAddonsColumns, PrimaryKey: []*schema.Column{PlanAddonsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "plan_addons_addons_plans", Columns: []*schema.Column{PlanAddonsColumns[9]}, RefColumns: []*schema.Column{AddonsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "plan_addons_plans_addons", Columns: []*schema.Column{PlanAddonsColumns[10]}, RefColumns: []*schema.Column{PlansColumns[0]}, OnDelete: schema.Cascade, }, }, Indexes: []*schema.Index{ { Name: "planaddon_id", Unique: true, Columns: []*schema.Column{PlanAddonsColumns[0]}, }, { Name: "planaddon_namespace", Unique: false, Columns: []*schema.Column{PlanAddonsColumns[1]}, }, { Name: "planaddon_annotations", Unique: false, Columns: []*schema.Column{PlanAddonsColumns[3]}, Annotation: &entsql.IndexAnnotation{ Types: map[string]string{ "postgres": "GIN", }, }, }, { Name: "planaddon_namespace_plan_id_addon_id", Unique: true, Columns: []*schema.Column{PlanAddonsColumns[1], PlanAddonsColumns[10], PlanAddonsColumns[9]}, Annotation: &entsql.IndexAnnotation{ Where: "deleted_at IS NULL", }, }, }, } // PlanPhasesColumns holds the columns for the "plan_phases" table. PlanPhasesColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "namespace", Type: field.TypeString}, {Name: "metadata", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "name", Type: field.TypeString}, {Name: "description", Type: field.TypeString, Nullable: true}, {Name: "key", Type: field.TypeString}, {Name: "index", Type: field.TypeUint8}, {Name: "duration", Type: field.TypeString, Nullable: true}, {Name: "plan_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, } // PlanPhasesTable holds the schema information for the "plan_phases" table. PlanPhasesTable = &schema.Table{ Name: "plan_phases", Columns: PlanPhasesColumns, PrimaryKey: []*schema.Column{PlanPhasesColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "plan_phases_plans_phases", Columns: []*schema.Column{PlanPhasesColumns[11]}, RefColumns: []*schema.Column{PlansColumns[0]}, OnDelete: schema.Cascade, }, }, Indexes: []*schema.Index{ { Name: "planphase_id", Unique: true, Columns: []*schema.Column{PlanPhasesColumns[0]}, }, { Name: "planphase_namespace", Unique: false, Columns: []*schema.Column{PlanPhasesColumns[1]}, }, { Name: "planphase_namespace_id", Unique: true, Columns: []*schema.Column{PlanPhasesColumns[1], PlanPhasesColumns[0]}, }, { Name: "planphase_namespace_key_deleted_at", Unique: true, Columns: []*schema.Column{PlanPhasesColumns[1], PlanPhasesColumns[8], PlanPhasesColumns[5]}, }, { Name: "planphase_namespace_key", Unique: false, Columns: []*schema.Column{PlanPhasesColumns[1], PlanPhasesColumns[8]}, }, { Name: "planphase_plan_id_key", Unique: true, Columns: []*schema.Column{PlanPhasesColumns[11], PlanPhasesColumns[8]}, Annotation: &entsql.IndexAnnotation{ Where: "deleted_at IS NULL", }, }, { Name: "planphase_plan_id_index", Unique: true, Columns: []*schema.Column{PlanPhasesColumns[11], PlanPhasesColumns[9]}, Annotation: &entsql.IndexAnnotation{ Where: "deleted_at IS NULL", }, }, }, } // PlanRateCardsColumns holds the columns for the "plan_rate_cards" table. PlanRateCardsColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "namespace", Type: field.TypeString}, {Name: "metadata", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "name", Type: field.TypeString}, {Name: "description", Type: field.TypeString, Nullable: true}, {Name: "key", Type: field.TypeString}, {Name: "tax_behavior", Type: field.TypeEnum, Nullable: true, Enums: []string{"inclusive", "exclusive"}}, {Name: "type", Type: field.TypeEnum, Enums: []string{"flat_fee", "usage_based"}}, {Name: "feature_key", Type: field.TypeString, Nullable: true}, {Name: "entitlement_template", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "tax_config", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "billing_cadence", Type: field.TypeString, Nullable: true}, {Name: "price", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "discounts", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "feature_id", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "phase_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "tax_code_id", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, } // PlanRateCardsTable holds the schema information for the "plan_rate_cards" table. PlanRateCardsTable = &schema.Table{ Name: "plan_rate_cards", Columns: PlanRateCardsColumns, PrimaryKey: []*schema.Column{PlanRateCardsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "plan_rate_cards_features_ratecard", Columns: []*schema.Column{PlanRateCardsColumns[17]}, RefColumns: []*schema.Column{FeaturesColumns[0]}, OnDelete: schema.SetNull, }, { Symbol: "plan_rate_cards_plan_phases_ratecards", Columns: []*schema.Column{PlanRateCardsColumns[18]}, RefColumns: []*schema.Column{PlanPhasesColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "plan_rate_cards_tax_codes_plan_rate_cards", Columns: []*schema.Column{PlanRateCardsColumns[19]}, RefColumns: []*schema.Column{TaxCodesColumns[0]}, OnDelete: schema.SetNull, }, }, Indexes: []*schema.Index{ { Name: "planratecard_id", Unique: true, Columns: []*schema.Column{PlanRateCardsColumns[0]}, }, { Name: "planratecard_namespace", Unique: false, Columns: []*schema.Column{PlanRateCardsColumns[1]}, }, { Name: "planratecard_namespace_id", Unique: true, Columns: []*schema.Column{PlanRateCardsColumns[1], PlanRateCardsColumns[0]}, }, { Name: "planratecard_namespace_key_deleted_at", Unique: true, Columns: []*schema.Column{PlanRateCardsColumns[1], PlanRateCardsColumns[8], PlanRateCardsColumns[5]}, }, { Name: "planratecard_tax_code_id", Unique: false, Columns: []*schema.Column{PlanRateCardsColumns[19]}, }, { Name: "planratecard_phase_id_key", Unique: true, Columns: []*schema.Column{PlanRateCardsColumns[18], PlanRateCardsColumns[8]}, Annotation: &entsql.IndexAnnotation{ Where: "deleted_at IS NULL", }, }, { Name: "planratecard_phase_id_feature_key", Unique: true, Columns: []*schema.Column{PlanRateCardsColumns[18], PlanRateCardsColumns[11]}, Annotation: &entsql.IndexAnnotation{ Where: "deleted_at IS NULL", }, }, }, } // SubjectsColumns holds the columns for the "subjects" table. SubjectsColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "namespace", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "key", Type: field.TypeString}, {Name: "display_name", Type: field.TypeString, Nullable: true}, {Name: "stripe_customer_id", Type: field.TypeString, Nullable: true}, {Name: "metadata", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, } // SubjectsTable holds the schema information for the "subjects" table. SubjectsTable = &schema.Table{ Name: "subjects", Columns: SubjectsColumns, PrimaryKey: []*schema.Column{SubjectsColumns[0]}, Indexes: []*schema.Index{ { Name: "subject_id", Unique: true, Columns: []*schema.Column{SubjectsColumns[0]}, }, { Name: "subject_namespace", Unique: false, Columns: []*schema.Column{SubjectsColumns[1]}, }, { Name: "subject_namespace_key", Unique: true, Columns: []*schema.Column{SubjectsColumns[1], SubjectsColumns[5]}, Annotation: &entsql.IndexAnnotation{ Where: "deleted_at IS NULL", }, }, { Name: "subject_namespace_key_deleted_at_unique", Unique: true, Columns: []*schema.Column{SubjectsColumns[1], SubjectsColumns[5], SubjectsColumns[4]}, Annotation: &entsql.IndexAnnotation{ Where: "deleted_at IS NULL", }, }, { Name: "subject_namespace_key_deleted_at", Unique: false, Columns: []*schema.Column{SubjectsColumns[1], SubjectsColumns[5], SubjectsColumns[4]}, }, { Name: "subject_namespace_id", Unique: true, Columns: []*schema.Column{SubjectsColumns[1], SubjectsColumns[0]}, }, { Name: "subject_display_name", Unique: false, Columns: []*schema.Column{SubjectsColumns[6]}, }, { Name: "subject_created_at_id", Unique: false, Columns: []*schema.Column{SubjectsColumns[2], SubjectsColumns[0]}, }, }, } // SubscriptionsColumns holds the columns for the "subscriptions" table. SubscriptionsColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "namespace", Type: field.TypeString}, {Name: "annotations", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "metadata", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "active_from", Type: field.TypeTime}, {Name: "active_to", Type: field.TypeTime, Nullable: true}, {Name: "name", Type: field.TypeString, Default: "Subscription"}, {Name: "description", Type: field.TypeString, Nullable: true}, {Name: "currency", Type: field.TypeString, Size: 3}, {Name: "billing_anchor", Type: field.TypeTime}, {Name: "billing_cadence", Type: field.TypeString}, {Name: "pro_rating_config", Type: field.TypeString, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "settlement_mode", Type: field.TypeEnum, Enums: []string{"credit_then_invoice", "credit_only"}, Default: "credit_then_invoice"}, {Name: "customer_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "plan_id", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, } // SubscriptionsTable holds the schema information for the "subscriptions" table. SubscriptionsTable = &schema.Table{ Name: "subscriptions", Columns: SubscriptionsColumns, PrimaryKey: []*schema.Column{SubscriptionsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "subscriptions_customers_subscription", Columns: []*schema.Column{SubscriptionsColumns[16]}, RefColumns: []*schema.Column{CustomersColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "subscriptions_plans_subscriptions", Columns: []*schema.Column{SubscriptionsColumns[17]}, RefColumns: []*schema.Column{PlansColumns[0]}, OnDelete: schema.SetNull, }, }, Indexes: []*schema.Index{ { Name: "subscription_id", Unique: true, Columns: []*schema.Column{SubscriptionsColumns[0]}, }, { Name: "subscription_namespace", Unique: false, Columns: []*schema.Column{SubscriptionsColumns[1]}, }, { Name: "subscription_annotations", Unique: false, Columns: []*schema.Column{SubscriptionsColumns[2]}, Annotation: &entsql.IndexAnnotation{ Types: map[string]string{ "postgres": "GIN", }, }, }, { Name: "subscription_namespace_id", Unique: false, Columns: []*schema.Column{SubscriptionsColumns[1], SubscriptionsColumns[0]}, }, { Name: "subscription_namespace_customer_id", Unique: false, Columns: []*schema.Column{SubscriptionsColumns[1], SubscriptionsColumns[16]}, }, }, } // SubscriptionAddonsColumns holds the columns for the "subscription_addons" table. SubscriptionAddonsColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "namespace", Type: field.TypeString}, {Name: "metadata", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "addon_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "subscription_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, } // SubscriptionAddonsTable holds the schema information for the "subscription_addons" table. SubscriptionAddonsTable = &schema.Table{ Name: "subscription_addons", Columns: SubscriptionAddonsColumns, PrimaryKey: []*schema.Column{SubscriptionAddonsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "subscription_addons_addons_subscription_addons", Columns: []*schema.Column{SubscriptionAddonsColumns[6]}, RefColumns: []*schema.Column{AddonsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "subscription_addons_subscriptions_addons", Columns: []*schema.Column{SubscriptionAddonsColumns[7]}, RefColumns: []*schema.Column{SubscriptionsColumns[0]}, OnDelete: schema.Cascade, }, }, Indexes: []*schema.Index{ { Name: "subscriptionaddon_id", Unique: true, Columns: []*schema.Column{SubscriptionAddonsColumns[0]}, }, { Name: "subscriptionaddon_namespace", Unique: false, Columns: []*schema.Column{SubscriptionAddonsColumns[1]}, }, }, } // SubscriptionAddonQuantitiesColumns holds the columns for the "subscription_addon_quantities" table. SubscriptionAddonQuantitiesColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "namespace", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "active_from", Type: field.TypeTime}, {Name: "quantity", Type: field.TypeInt, Default: 1}, {Name: "subscription_addon_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, } // SubscriptionAddonQuantitiesTable holds the schema information for the "subscription_addon_quantities" table. SubscriptionAddonQuantitiesTable = &schema.Table{ Name: "subscription_addon_quantities", Columns: SubscriptionAddonQuantitiesColumns, PrimaryKey: []*schema.Column{SubscriptionAddonQuantitiesColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "subscription_addon_quantities_subscription_addons_quantities", Columns: []*schema.Column{SubscriptionAddonQuantitiesColumns[7]}, RefColumns: []*schema.Column{SubscriptionAddonsColumns[0]}, OnDelete: schema.Cascade, }, }, Indexes: []*schema.Index{ { Name: "subscriptionaddonquantity_id", Unique: true, Columns: []*schema.Column{SubscriptionAddonQuantitiesColumns[0]}, }, { Name: "subscriptionaddonquantity_namespace", Unique: false, Columns: []*schema.Column{SubscriptionAddonQuantitiesColumns[1]}, }, { Name: "subscriptionaddonquantity_subscription_addon_id", Unique: false, Columns: []*schema.Column{SubscriptionAddonQuantitiesColumns[7]}, }, }, } // SubscriptionBillingSyncStatesColumns holds the columns for the "subscription_billing_sync_states" table. SubscriptionBillingSyncStatesColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "namespace", Type: field.TypeString}, {Name: "has_billables", Type: field.TypeBool}, {Name: "synced_at", Type: field.TypeTime}, {Name: "next_sync_after", Type: field.TypeTime, Nullable: true}, {Name: "subscription_id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, } // SubscriptionBillingSyncStatesTable holds the schema information for the "subscription_billing_sync_states" table. SubscriptionBillingSyncStatesTable = &schema.Table{ Name: "subscription_billing_sync_states", Columns: SubscriptionBillingSyncStatesColumns, PrimaryKey: []*schema.Column{SubscriptionBillingSyncStatesColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "subscription_billing_sync_states_subscriptions_billing_sync_state", Columns: []*schema.Column{SubscriptionBillingSyncStatesColumns[5]}, RefColumns: []*schema.Column{SubscriptionsColumns[0]}, OnDelete: schema.Cascade, }, }, Indexes: []*schema.Index{ { Name: "subscriptionbillingsyncstate_id", Unique: true, Columns: []*schema.Column{SubscriptionBillingSyncStatesColumns[0]}, }, { Name: "subscriptionbillingsyncstate_namespace", Unique: false, Columns: []*schema.Column{SubscriptionBillingSyncStatesColumns[1]}, }, { Name: "subscriptionbillingsyncstate_namespace_subscription_id", Unique: true, Columns: []*schema.Column{SubscriptionBillingSyncStatesColumns[1], SubscriptionBillingSyncStatesColumns[5]}, }, }, } // SubscriptionItemsColumns holds the columns for the "subscription_items" table. SubscriptionItemsColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "namespace", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "metadata", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "tax_behavior", Type: field.TypeEnum, Nullable: true, Enums: []string{"inclusive", "exclusive"}}, {Name: "annotations", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "active_from", Type: field.TypeTime}, {Name: "active_to", Type: field.TypeTime, Nullable: true}, {Name: "key", Type: field.TypeString}, {Name: "restarts_billing_period", Type: field.TypeBool, Nullable: true}, {Name: "active_from_override_relative_to_phase_start", Type: field.TypeString, Nullable: true}, {Name: "active_to_override_relative_to_phase_start", Type: field.TypeString, Nullable: true}, {Name: "name", Type: field.TypeString}, {Name: "description", Type: field.TypeString, Nullable: true}, {Name: "feature_key", Type: field.TypeString, Nullable: true}, {Name: "entitlement_template", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "tax_config", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "billing_cadence", Type: field.TypeString, Nullable: true}, {Name: "price", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "discounts", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "entitlement_id", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "phase_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "tax_code_id", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "char(26)"}}, } // SubscriptionItemsTable holds the schema information for the "subscription_items" table. SubscriptionItemsTable = &schema.Table{ Name: "subscription_items", Columns: SubscriptionItemsColumns, PrimaryKey: []*schema.Column{SubscriptionItemsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "subscription_items_entitlements_subscription_item", Columns: []*schema.Column{SubscriptionItemsColumns[22]}, RefColumns: []*schema.Column{EntitlementsColumns[0]}, OnDelete: schema.SetNull, }, { Symbol: "subscription_items_subscription_phases_items", Columns: []*schema.Column{SubscriptionItemsColumns[23]}, RefColumns: []*schema.Column{SubscriptionPhasesColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "subscription_items_tax_codes_subscription_items", Columns: []*schema.Column{SubscriptionItemsColumns[24]}, RefColumns: []*schema.Column{TaxCodesColumns[0]}, OnDelete: schema.SetNull, }, }, Indexes: []*schema.Index{ { Name: "subscriptionitem_id", Unique: true, Columns: []*schema.Column{SubscriptionItemsColumns[0]}, }, { Name: "subscriptionitem_namespace", Unique: false, Columns: []*schema.Column{SubscriptionItemsColumns[1]}, }, { Name: "subscriptionitem_tax_code_id", Unique: false, Columns: []*schema.Column{SubscriptionItemsColumns[24]}, }, { Name: "subscriptionitem_namespace_id", Unique: false, Columns: []*schema.Column{SubscriptionItemsColumns[1], SubscriptionItemsColumns[0]}, }, { Name: "subscriptionitem_namespace_phase_id_key", Unique: false, Columns: []*schema.Column{SubscriptionItemsColumns[1], SubscriptionItemsColumns[23], SubscriptionItemsColumns[10]}, }, }, } // SubscriptionPhasesColumns holds the columns for the "subscription_phases" table. SubscriptionPhasesColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "namespace", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "metadata", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "key", Type: field.TypeString}, {Name: "name", Type: field.TypeString}, {Name: "description", Type: field.TypeString, Nullable: true}, {Name: "active_from", Type: field.TypeTime}, {Name: "sort_hint", Type: field.TypeUint8, Nullable: true}, {Name: "subscription_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, } // SubscriptionPhasesTable holds the schema information for the "subscription_phases" table. SubscriptionPhasesTable = &schema.Table{ Name: "subscription_phases", Columns: SubscriptionPhasesColumns, PrimaryKey: []*schema.Column{SubscriptionPhasesColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "subscription_phases_subscriptions_phases", Columns: []*schema.Column{SubscriptionPhasesColumns[11]}, RefColumns: []*schema.Column{SubscriptionsColumns[0]}, OnDelete: schema.Cascade, }, }, Indexes: []*schema.Index{ { Name: "subscriptionphase_id", Unique: true, Columns: []*schema.Column{SubscriptionPhasesColumns[0]}, }, { Name: "subscriptionphase_namespace", Unique: false, Columns: []*schema.Column{SubscriptionPhasesColumns[1]}, }, { Name: "subscriptionphase_namespace_id", Unique: false, Columns: []*schema.Column{SubscriptionPhasesColumns[1], SubscriptionPhasesColumns[0]}, }, { Name: "subscriptionphase_namespace_subscription_id", Unique: false, Columns: []*schema.Column{SubscriptionPhasesColumns[1], SubscriptionPhasesColumns[11]}, }, { Name: "subscriptionphase_namespace_subscription_id_key", Unique: false, Columns: []*schema.Column{SubscriptionPhasesColumns[1], SubscriptionPhasesColumns[11], SubscriptionPhasesColumns[6]}, }, }, } // TaxCodesColumns holds the columns for the "tax_codes" table. TaxCodesColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "namespace", Type: field.TypeString}, {Name: "metadata", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "name", Type: field.TypeString}, {Name: "description", Type: field.TypeString, Nullable: true}, {Name: "key", Type: field.TypeString}, {Name: "annotations", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "app_mappings", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, } // TaxCodesTable holds the schema information for the "tax_codes" table. TaxCodesTable = &schema.Table{ Name: "tax_codes", Columns: TaxCodesColumns, PrimaryKey: []*schema.Column{TaxCodesColumns[0]}, Indexes: []*schema.Index{ { Name: "taxcode_id", Unique: true, Columns: []*schema.Column{TaxCodesColumns[0]}, }, { Name: "taxcode_namespace", Unique: false, Columns: []*schema.Column{TaxCodesColumns[1]}, }, { Name: "taxcode_namespace_id", Unique: true, Columns: []*schema.Column{TaxCodesColumns[1], TaxCodesColumns[0]}, }, { Name: "taxcode_namespace_key_deleted_at", Unique: true, Columns: []*schema.Column{TaxCodesColumns[1], TaxCodesColumns[8], TaxCodesColumns[5]}, }, { Name: "taxcode_annotations", Unique: false, Columns: []*schema.Column{TaxCodesColumns[9]}, Annotation: &entsql.IndexAnnotation{ Types: map[string]string{ "postgres": "GIN", }, }, }, { Name: "taxcode_namespace_key", Unique: true, Columns: []*schema.Column{TaxCodesColumns[1], TaxCodesColumns[8]}, Annotation: &entsql.IndexAnnotation{ Where: "deleted_at IS NULL", }, }, }, } // UsageResetsColumns holds the columns for the "usage_resets" table. UsageResetsColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "namespace", Type: field.TypeString}, {Name: "annotations", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "reset_time", Type: field.TypeTime}, {Name: "anchor", Type: field.TypeTime}, {Name: "usage_period_interval", Type: field.TypeString}, {Name: "entitlement_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, } // UsageResetsTable holds the schema information for the "usage_resets" table. UsageResetsTable = &schema.Table{ Name: "usage_resets", Columns: UsageResetsColumns, PrimaryKey: []*schema.Column{UsageResetsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "usage_resets_entitlements_usage_reset", Columns: []*schema.Column{UsageResetsColumns[9]}, RefColumns: []*schema.Column{EntitlementsColumns[0]}, OnDelete: schema.Cascade, }, }, Indexes: []*schema.Index{ { Name: "usagereset_id", Unique: true, Columns: []*schema.Column{UsageResetsColumns[0]}, }, { Name: "usagereset_namespace", Unique: false, Columns: []*schema.Column{UsageResetsColumns[1]}, }, { Name: "usagereset_annotations", Unique: false, Columns: []*schema.Column{UsageResetsColumns[2]}, Annotation: &entsql.IndexAnnotation{ Types: map[string]string{ "postgres": "GIN", }, }, }, { Name: "usagereset_namespace_entitlement_id", Unique: false, Columns: []*schema.Column{UsageResetsColumns[1], UsageResetsColumns[9]}, }, { Name: "usagereset_namespace_entitlement_id_reset_time", Unique: false, Columns: []*schema.Column{UsageResetsColumns[1], UsageResetsColumns[9], UsageResetsColumns[6]}, }, }, } // NotificationChannelRulesColumns holds the columns for the "notification_channel_rules" table. NotificationChannelRulesColumns = []*schema.Column{ {Name: "notification_channel_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "notification_rule_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, } // NotificationChannelRulesTable holds the schema information for the "notification_channel_rules" table. NotificationChannelRulesTable = &schema.Table{ Name: "notification_channel_rules", Columns: NotificationChannelRulesColumns, PrimaryKey: []*schema.Column{NotificationChannelRulesColumns[0], NotificationChannelRulesColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "notification_channel_rules_notification_channel_id", Columns: []*schema.Column{NotificationChannelRulesColumns[0]}, RefColumns: []*schema.Column{NotificationChannelsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "notification_channel_rules_notification_rule_id", Columns: []*schema.Column{NotificationChannelRulesColumns[1]}, RefColumns: []*schema.Column{NotificationRulesColumns[0]}, OnDelete: schema.Cascade, }, }, } // NotificationEventDeliveryStatusEventsColumns holds the columns for the "notification_event_delivery_status_events" table. NotificationEventDeliveryStatusEventsColumns = []*schema.Column{ {Name: "notification_event_delivery_status_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, {Name: "notification_event_id", Type: field.TypeString, SchemaType: map[string]string{"postgres": "char(26)"}}, } // NotificationEventDeliveryStatusEventsTable holds the schema information for the "notification_event_delivery_status_events" table. NotificationEventDeliveryStatusEventsTable = &schema.Table{ Name: "notification_event_delivery_status_events", Columns: NotificationEventDeliveryStatusEventsColumns, PrimaryKey: []*schema.Column{NotificationEventDeliveryStatusEventsColumns[0], NotificationEventDeliveryStatusEventsColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "notification_event_delivery_status_events_notification_event_delivery_status_id", Columns: []*schema.Column{NotificationEventDeliveryStatusEventsColumns[0]}, RefColumns: []*schema.Column{NotificationEventDeliveryStatusColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "notification_event_delivery_status_events_notification_event_id", Columns: []*schema.Column{NotificationEventDeliveryStatusEventsColumns[1]}, RefColumns: []*schema.Column{NotificationEventsColumns[0]}, OnDelete: schema.Cascade, }, }, } // Tables holds all the tables in the schema. Tables = []*schema.Table{ AddonsTable, AddonRateCardsTable, AppsTable, AppCustomInvoicingsTable, AppCustomInvoicingCustomersTable, AppCustomersTable, AppStripesTable, AppStripeCustomersTable, BalanceSnapshotsTable, BillingCustomerLocksTable, BillingCustomerOverridesTable, BillingInvoicesTable, BillingInvoiceFlatFeeLineConfigsTable, BillingInvoiceLinesTable, BillingInvoiceLineDiscountsTable, BillingInvoiceLineUsageDiscountsTable, BillingInvoiceSplitLineGroupsTable, BillingInvoiceUsageBasedLineConfigsTable, BillingInvoiceValidationIssuesTable, BillingInvoiceWriteSchemaLevelsTable, BillingProfilesTable, BillingSequenceNumbersTable, BillingStandardInvoiceDetailedLinesTable, BillingStandardInvoiceDetailedLineAmountDiscountsTable, BillingWorkflowConfigsTable, ChargesTable, ChargeCreditPurchasesTable, ChargeCreditPurchaseCreditGrantsTable, ChargeCreditPurchaseExternalPaymentsTable, ChargeCreditPurchaseInvoicedPaymentsTable, ChargeFlatFeesTable, ChargeFlatFeeRunsTable, ChargeFlatFeeRunCreditAllocationsTable, ChargeFlatFeeRunDetailedLinesTable, ChargeFlatFeeRunInvoicedUsagesTable, ChargeFlatFeeRunPaymentsTable, ChargeUsageBasedTable, ChargeUsageBasedRunCreditAllocationsTable, ChargeUsageBasedRunDetailedLineTable, ChargeUsageBasedRunInvoicedUsagesTable, ChargeUsageBasedRunPaymentsTable, ChargeUsageBasedRunsTable, CreditRealizationLineagesTable, CreditRealizationLineageSegmentsTable, CurrencyCostBasesTable, CustomCurrenciesTable, CustomersTable, CustomerSubjectsTable, EntitlementsTable, FeaturesTable, GrantsTable, LlmCostPricesTable, LedgerAccountsTable, LedgerCustomerAccountsTable, LedgerEntriesTable, LedgerSubAccountsTable, LedgerSubAccountRoutesTable, LedgerTransactionsTable, LedgerTransactionGroupsTable, MetersTable, NotificationChannelsTable, NotificationEventsTable, NotificationEventDeliveryStatusTable, NotificationRulesTable, OrganizationDefaultTaxCodesTable, PlansTable, PlanAddonsTable, PlanPhasesTable, PlanRateCardsTable, SubjectsTable, SubscriptionsTable, SubscriptionAddonsTable, SubscriptionAddonQuantitiesTable, SubscriptionBillingSyncStatesTable, SubscriptionItemsTable, SubscriptionPhasesTable, TaxCodesTable, UsageResetsTable, NotificationChannelRulesTable, NotificationEventDeliveryStatusEventsTable, } )
Functions ¶
func Create ¶
func Create(ctx context.Context, s *Schema, tables []*schema.Table, opts ...schema.MigrateOption) error
Create creates all table resources using the given schema driver.
Types ¶
type Schema ¶
type Schema struct {
// contains filtered or unexported fields
}
Schema is the API for creating, migrating and dropping a schema.
func (*Schema) Diff ¶
Diff creates a migration file containing the statements to resolve the diff between the Ent schema and the connected database.
func (*Schema) NamedDiff ¶
NamedDiff creates a named migration file containing the statements to resolve the diff between the Ent schema and the connected database.
Click to show internal directories.
Click to hide internal directories.