Documentation ¶
Index ¶
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 ( // AccessorialChargesColumns holds the columns for the "accessorial_charges" table. AccessorialChargesColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "version", Type: field.TypeInt, Default: 1}, {Name: "status", Type: field.TypeEnum, Enums: []string{"A", "I"}, Default: "A", SchemaType: map[string]string{"postgres": "VARCHAR(1)", "sqlite3": "VARCHAR(1)"}}, {Name: "code", Type: field.TypeString, Size: 4, SchemaType: map[string]string{"postgres": "VARCHAR(4)", "sqlite3": "VARCHAR(4)"}}, {Name: "description", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "is_detention", Type: field.TypeBool, Default: false}, {Name: "method", Type: field.TypeEnum, Enums: []string{"Distance", "Flat", "Percentage"}, SchemaType: map[string]string{"postgres": "VARCHAR(10)", "sqlite3": "VARCHAR(10)"}}, {Name: "amount", Type: field.TypeFloat64, Default: 0, SchemaType: map[string]string{"mysql": "decimal(19,4)", "postgres": "numeric(19,4)"}}, {Name: "business_unit_id", Type: field.TypeUUID}, {Name: "organization_id", Type: field.TypeUUID}, } // AccessorialChargesTable holds the schema information for the "accessorial_charges" table. AccessorialChargesTable = &schema.Table{ Name: "accessorial_charges", Columns: AccessorialChargesColumns, PrimaryKey: []*schema.Column{AccessorialChargesColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "accessorial_charges_business_units_business_unit", Columns: []*schema.Column{AccessorialChargesColumns[10]}, RefColumns: []*schema.Column{BusinessUnitsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "accessorial_charges_organizations_organization", Columns: []*schema.Column{AccessorialChargesColumns[11]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.Cascade, }, }, Indexes: []*schema.Index{ { Name: "accessorialcharge_code_organization_id", Unique: true, Columns: []*schema.Column{AccessorialChargesColumns[5], AccessorialChargesColumns[11]}, }, }, } // AccountingControlsColumns holds the columns for the "accounting_controls" table. AccountingControlsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "rec_threshold", Type: field.TypeInt8, Default: 50}, {Name: "rec_threshold_action", Type: field.TypeEnum, Enums: []string{"Halt", "Warn"}, Default: "Halt", SchemaType: map[string]string{"mysql": "ENUM('Halt', 'Warn')"}}, {Name: "auto_create_journal_entries", Type: field.TypeBool, Default: false}, {Name: "journal_entry_criteria", Type: field.TypeEnum, Enums: []string{"OnShipmentBill", "OnReceiptOfPayment", "OnExpenseRecognition"}, Default: "OnShipmentBill"}, {Name: "restrict_manual_journal_entries", Type: field.TypeBool, Default: false}, {Name: "require_journal_entry_approval", Type: field.TypeBool, Default: false}, {Name: "enable_rec_notifications", Type: field.TypeBool, Default: true}, {Name: "halt_on_pending_rec", Type: field.TypeBool, Default: false}, {Name: "critical_processes", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "business_unit_id", Type: field.TypeUUID}, {Name: "default_rev_account_id", Type: field.TypeUUID, Nullable: true}, {Name: "default_exp_account_id", Type: field.TypeUUID, Nullable: true}, {Name: "organization_id", Type: field.TypeUUID, Unique: true}, } // AccountingControlsTable holds the schema information for the "accounting_controls" table. AccountingControlsTable = &schema.Table{ Name: "accounting_controls", Columns: AccountingControlsColumns, PrimaryKey: []*schema.Column{AccountingControlsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "accounting_controls_business_units_business_unit", Columns: []*schema.Column{AccountingControlsColumns[12]}, RefColumns: []*schema.Column{BusinessUnitsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "accounting_controls_general_ledger_accounts_default_rev_account", Columns: []*schema.Column{AccountingControlsColumns[13]}, RefColumns: []*schema.Column{GeneralLedgerAccountsColumns[0]}, OnDelete: schema.SetNull, }, { Symbol: "accounting_controls_general_ledger_accounts_default_exp_account", Columns: []*schema.Column{AccountingControlsColumns[14]}, RefColumns: []*schema.Column{GeneralLedgerAccountsColumns[0]}, OnDelete: schema.SetNull, }, { Symbol: "accounting_controls_organizations_accounting_control", Columns: []*schema.Column{AccountingControlsColumns[15]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.NoAction, }, }, } // BillingControlsColumns holds the columns for the "billing_controls" table. BillingControlsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "remove_billing_history", Type: field.TypeBool, Default: false}, {Name: "auto_bill_shipment", Type: field.TypeBool, Default: false}, {Name: "auto_mark_ready_to_bill", Type: field.TypeBool, Default: false}, {Name: "validate_customer_rates", Type: field.TypeBool, Default: false}, {Name: "auto_bill_criteria", Type: field.TypeEnum, Enums: []string{"Delivered", "TransferredToBilling", "MarkedReadyToBill"}, Default: "MarkedReadyToBill"}, {Name: "shipment_transfer_criteria", Type: field.TypeEnum, Enums: []string{"ReadyAndCompleted", "Completed", "ReadyToBill"}, Default: "ReadyToBill", SchemaType: map[string]string{"postgres": "VARCHAR(17)", "sqlite3": "VARCHAR(17)"}}, {Name: "enforce_customer_billing", Type: field.TypeBool, Default: false}, {Name: "business_unit_id", Type: field.TypeUUID}, {Name: "organization_id", Type: field.TypeUUID, Unique: true}, } // BillingControlsTable holds the schema information for the "billing_controls" table. BillingControlsTable = &schema.Table{ Name: "billing_controls", Columns: BillingControlsColumns, PrimaryKey: []*schema.Column{BillingControlsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "billing_controls_business_units_business_unit", Columns: []*schema.Column{BillingControlsColumns[10]}, RefColumns: []*schema.Column{BusinessUnitsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "billing_controls_organizations_billing_control", Columns: []*schema.Column{BillingControlsColumns[11]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.NoAction, }, }, } // BusinessUnitsColumns holds the columns for the "business_units" table. BusinessUnitsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "status", Type: field.TypeEnum, Enums: []string{"A", "I"}, Default: "A"}, {Name: "name", Type: field.TypeString, Size: 255}, {Name: "entity_key", Type: field.TypeString, Size: 10}, {Name: "phone_number", Type: field.TypeString, Size: 15}, {Name: "address", Type: field.TypeString, Nullable: true}, {Name: "city", Type: field.TypeString, Nullable: true, Size: 255}, {Name: "state", Type: field.TypeString, Nullable: true, Size: 2}, {Name: "country", Type: field.TypeString, Nullable: true, Size: 2}, {Name: "postal_code", Type: field.TypeString, Nullable: true, Size: 10}, {Name: "tax_id", Type: field.TypeString, Nullable: true, Size: 20}, {Name: "subscription_plan", Type: field.TypeString, Nullable: true}, {Name: "description", Type: field.TypeString, Nullable: true}, {Name: "legal_name", Type: field.TypeString, Nullable: true}, {Name: "contact_name", Type: field.TypeString, Nullable: true}, {Name: "contact_email", Type: field.TypeString, Nullable: true}, {Name: "paid_until", Type: field.TypeTime, Nullable: true}, {Name: "settings", Type: field.TypeJSON, Nullable: true}, {Name: "free_trial", Type: field.TypeBool, Default: false}, {Name: "parent_id", Type: field.TypeUUID, Unique: true, Nullable: true}, } // BusinessUnitsTable holds the schema information for the "business_units" table. BusinessUnitsTable = &schema.Table{ Name: "business_units", Columns: BusinessUnitsColumns, PrimaryKey: []*schema.Column{BusinessUnitsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "business_units_business_units_next", Columns: []*schema.Column{BusinessUnitsColumns[21]}, RefColumns: []*schema.Column{BusinessUnitsColumns[0]}, OnDelete: schema.SetNull, }, }, Indexes: []*schema.Index{ { Name: "businessunit_name", Unique: true, Columns: []*schema.Column{BusinessUnitsColumns[4]}, }, { Name: "businessunit_entity_key", Unique: true, Columns: []*schema.Column{BusinessUnitsColumns[5]}, }, }, } // ChargeTypesColumns holds the columns for the "charge_types" table. ChargeTypesColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "version", Type: field.TypeInt, Default: 1}, {Name: "status", Type: field.TypeEnum, Enums: []string{"A", "I"}, Default: "A", SchemaType: map[string]string{"postgres": "VARCHAR(1)", "sqlite3": "VARCHAR(1)"}}, {Name: "name", Type: field.TypeString, Size: 50, SchemaType: map[string]string{"postgres": "VARCHAR(50)", "sqlite3": "VARCHAR(50)"}}, {Name: "description", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "business_unit_id", Type: field.TypeUUID}, {Name: "organization_id", Type: field.TypeUUID}, } // ChargeTypesTable holds the schema information for the "charge_types" table. ChargeTypesTable = &schema.Table{ Name: "charge_types", Columns: ChargeTypesColumns, PrimaryKey: []*schema.Column{ChargeTypesColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "charge_types_business_units_business_unit", Columns: []*schema.Column{ChargeTypesColumns[7]}, RefColumns: []*schema.Column{BusinessUnitsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "charge_types_organizations_organization", Columns: []*schema.Column{ChargeTypesColumns[8]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.Cascade, }, }, Indexes: []*schema.Index{ { Name: "chargetype_name_organization_id", Unique: true, Columns: []*schema.Column{ChargeTypesColumns[5], ChargeTypesColumns[8]}, }, }, } // CommentTypesColumns holds the columns for the "comment_types" table. CommentTypesColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "version", Type: field.TypeInt, Default: 1}, {Name: "status", Type: field.TypeEnum, Enums: []string{"A", "I"}, Default: "A", SchemaType: map[string]string{"postgres": "VARCHAR(1)", "sqlite3": "VARCHAR(1)"}}, {Name: "name", Type: field.TypeString, Size: 10, SchemaType: map[string]string{"postgres": "VARCHAR(10)", "sqlite3": "VARCHAR(10)"}}, {Name: "severity", Type: field.TypeEnum, Enums: []string{"High", "Medium", "Low"}, Default: "Low", SchemaType: map[string]string{"postgres": "VARCHAR(6)", "sqlite3": "VARCHAR(6)"}}, {Name: "description", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "business_unit_id", Type: field.TypeUUID}, {Name: "organization_id", Type: field.TypeUUID}, } // CommentTypesTable holds the schema information for the "comment_types" table. CommentTypesTable = &schema.Table{ Name: "comment_types", Columns: CommentTypesColumns, PrimaryKey: []*schema.Column{CommentTypesColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "comment_types_business_units_business_unit", Columns: []*schema.Column{CommentTypesColumns[8]}, RefColumns: []*schema.Column{BusinessUnitsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "comment_types_organizations_organization", Columns: []*schema.Column{CommentTypesColumns[9]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.Cascade, }, }, Indexes: []*schema.Index{ { Name: "commenttype_name_organization_id", Unique: true, Columns: []*schema.Column{CommentTypesColumns[5], CommentTypesColumns[9]}, }, }, } // CommoditiesColumns holds the columns for the "commodities" table. CommoditiesColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "version", Type: field.TypeInt, Default: 1}, {Name: "status", Type: field.TypeEnum, Enums: []string{"A", "I"}, Default: "A", SchemaType: map[string]string{"postgres": "VARCHAR(1)", "sqlite3": "VARCHAR(1)"}}, {Name: "name", Type: field.TypeString, Size: 100, SchemaType: map[string]string{"postgres": "VARCHAR(100)", "sqlite3": "VARCHAR(100)"}}, {Name: "is_hazmat", Type: field.TypeBool, Default: false}, {Name: "unit_of_measure", Type: field.TypeString, Nullable: true}, {Name: "min_temp", Type: field.TypeInt8, Nullable: true}, {Name: "max_temp", Type: field.TypeInt8, Nullable: true}, {Name: "description", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "business_unit_id", Type: field.TypeUUID}, {Name: "organization_id", Type: field.TypeUUID}, {Name: "hazardous_material_id", Type: field.TypeUUID, Nullable: true}, } // CommoditiesTable holds the schema information for the "commodities" table. CommoditiesTable = &schema.Table{ Name: "commodities", Columns: CommoditiesColumns, PrimaryKey: []*schema.Column{CommoditiesColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "commodities_business_units_business_unit", Columns: []*schema.Column{CommoditiesColumns[11]}, RefColumns: []*schema.Column{BusinessUnitsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "commodities_organizations_organization", Columns: []*schema.Column{CommoditiesColumns[12]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "commodities_hazardous_materials_hazardous_material", Columns: []*schema.Column{CommoditiesColumns[13]}, RefColumns: []*schema.Column{HazardousMaterialsColumns[0]}, OnDelete: schema.Restrict, }, }, } // CustomersColumns holds the columns for the "customers" table. CustomersColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "version", Type: field.TypeInt, Default: 1}, {Name: "status", Type: field.TypeEnum, Enums: []string{"A", "I"}, Default: "A", SchemaType: map[string]string{"postgres": "VARCHAR(1)", "sqlite3": "VARCHAR(1)"}}, {Name: "code", Type: field.TypeString, Size: 10, SchemaType: map[string]string{"postgres": "VARCHAR(10)", "sqlite3": "VARCHAR(10)"}}, {Name: "name", Type: field.TypeString, Size: 150, SchemaType: map[string]string{"postgres": "VARCHAR(150)", "sqlite3": "VARCHAR(150)"}}, {Name: "address_line_1", Type: field.TypeString, Size: 150, SchemaType: map[string]string{"postgres": "VARCHAR(150)", "sqlite3": "VARCHAR(150)"}}, {Name: "address_line_2", Type: field.TypeString, Nullable: true, Size: 150, SchemaType: map[string]string{"postgres": "VARCHAR(150)", "sqlite3": "VARCHAR(150)"}}, {Name: "city", Type: field.TypeString, Size: 150, SchemaType: map[string]string{"postgres": "VARCHAR(150)", "sqlite3": "VARCHAR(150)"}}, {Name: "postal_code", Type: field.TypeString, Size: 10, SchemaType: map[string]string{"postgres": "VARCHAR(10)", "sqlite3": "VARCHAR(10)"}}, {Name: "has_customer_portal", Type: field.TypeBool, Default: false}, {Name: "auto_mark_ready_to_bill", Type: field.TypeBool, Default: false}, {Name: "business_unit_id", Type: field.TypeUUID}, {Name: "organization_id", Type: field.TypeUUID}, {Name: "state_id", Type: field.TypeUUID}, } // CustomersTable holds the schema information for the "customers" table. CustomersTable = &schema.Table{ Name: "customers", Columns: CustomersColumns, PrimaryKey: []*schema.Column{CustomersColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "customers_business_units_business_unit", Columns: []*schema.Column{CustomersColumns[13]}, RefColumns: []*schema.Column{BusinessUnitsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "customers_organizations_organization", Columns: []*schema.Column{CustomersColumns[14]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "customers_us_states_state", Columns: []*schema.Column{CustomersColumns[15]}, RefColumns: []*schema.Column{UsStatesColumns[0]}, OnDelete: schema.Cascade, }, }, Indexes: []*schema.Index{ { Name: "customer_code_organization_id", Unique: true, Columns: []*schema.Column{CustomersColumns[5], CustomersColumns[14]}, }, }, } // DelayCodesColumns holds the columns for the "delay_codes" table. DelayCodesColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "version", Type: field.TypeInt, Default: 1}, {Name: "status", Type: field.TypeEnum, Enums: []string{"A", "I"}, Default: "A", SchemaType: map[string]string{"postgres": "VARCHAR(1)", "sqlite3": "VARCHAR(1)"}}, {Name: "code", Type: field.TypeString, Size: 4, SchemaType: map[string]string{"postgres": "VARCHAR(4)", "sqlite3": "VARCHAR(4)"}}, {Name: "description", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "f_carrier_or_driver", Type: field.TypeBool, Nullable: true}, {Name: "business_unit_id", Type: field.TypeUUID}, {Name: "organization_id", Type: field.TypeUUID}, } // DelayCodesTable holds the schema information for the "delay_codes" table. DelayCodesTable = &schema.Table{ Name: "delay_codes", Columns: DelayCodesColumns, PrimaryKey: []*schema.Column{DelayCodesColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "delay_codes_business_units_business_unit", Columns: []*schema.Column{DelayCodesColumns[8]}, RefColumns: []*schema.Column{BusinessUnitsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "delay_codes_organizations_organization", Columns: []*schema.Column{DelayCodesColumns[9]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.Cascade, }, }, Indexes: []*schema.Index{ { Name: "delaycode_code_organization_id", Unique: true, Columns: []*schema.Column{DelayCodesColumns[5], DelayCodesColumns[9]}, }, }, } // DispatchControlsColumns holds the columns for the "dispatch_controls" table. DispatchControlsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "record_service_incident", Type: field.TypeEnum, Enums: []string{"Never", "Pickup", "Delivery", "PickupAndDelivery", "AllExceptShipper"}, Default: "Never", SchemaType: map[string]string{"postgres": "VARCHAR(17)", "sqlite3": "VARCHAR(17)"}}, {Name: "deadhead_target", Type: field.TypeFloat64, Default: 0}, {Name: "max_shipment_weight_limit", Type: field.TypeInt32, Default: 80000}, {Name: "grace_period", Type: field.TypeUint8, Default: 0}, {Name: "enforce_worker_assign", Type: field.TypeBool, Default: true}, {Name: "trailer_continuity", Type: field.TypeBool, Default: false}, {Name: "dupe_trailer_check", Type: field.TypeBool, Default: false}, {Name: "maintenance_compliance", Type: field.TypeBool, Default: true}, {Name: "regulatory_check", Type: field.TypeBool, Default: false}, {Name: "prev_shipment_on_hold", Type: field.TypeBool, Default: false}, {Name: "worker_time_away_restriction", Type: field.TypeBool, Default: true}, {Name: "tractor_worker_fleet_constraint", Type: field.TypeBool, Default: false}, {Name: "business_unit_id", Type: field.TypeUUID}, {Name: "organization_id", Type: field.TypeUUID, Unique: true}, } // DispatchControlsTable holds the schema information for the "dispatch_controls" table. DispatchControlsTable = &schema.Table{ Name: "dispatch_controls", Columns: DispatchControlsColumns, PrimaryKey: []*schema.Column{DispatchControlsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "dispatch_controls_business_units_business_unit", Columns: []*schema.Column{DispatchControlsColumns[15]}, RefColumns: []*schema.Column{BusinessUnitsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "dispatch_controls_organizations_dispatch_control", Columns: []*schema.Column{DispatchControlsColumns[16]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.NoAction, }, }, } // DivisionCodesColumns holds the columns for the "division_codes" table. DivisionCodesColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "version", Type: field.TypeInt, Default: 1}, {Name: "status", Type: field.TypeEnum, Enums: []string{"A", "I"}, Default: "A", SchemaType: map[string]string{"postgres": "VARCHAR(1)", "sqlite3": "VARCHAR(1)"}}, {Name: "code", Type: field.TypeString, Size: 4, SchemaType: map[string]string{"postgres": "VARCHAR(4)", "sqlite3": "VARCHAR(4)"}}, {Name: "description", Type: field.TypeString, Size: 2147483647}, {Name: "business_unit_id", Type: field.TypeUUID}, {Name: "organization_id", Type: field.TypeUUID}, {Name: "cash_account_id", Type: field.TypeUUID, Nullable: true}, {Name: "ap_account_id", Type: field.TypeUUID, Nullable: true}, {Name: "expense_account_id", Type: field.TypeUUID, Nullable: true}, } // DivisionCodesTable holds the schema information for the "division_codes" table. DivisionCodesTable = &schema.Table{ Name: "division_codes", Columns: DivisionCodesColumns, PrimaryKey: []*schema.Column{DivisionCodesColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "division_codes_business_units_business_unit", Columns: []*schema.Column{DivisionCodesColumns[7]}, RefColumns: []*schema.Column{BusinessUnitsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "division_codes_organizations_organization", Columns: []*schema.Column{DivisionCodesColumns[8]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "division_codes_general_ledger_accounts_cash_account", Columns: []*schema.Column{DivisionCodesColumns[9]}, RefColumns: []*schema.Column{GeneralLedgerAccountsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "division_codes_general_ledger_accounts_ap_account", Columns: []*schema.Column{DivisionCodesColumns[10]}, RefColumns: []*schema.Column{GeneralLedgerAccountsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "division_codes_general_ledger_accounts_expense_account", Columns: []*schema.Column{DivisionCodesColumns[11]}, RefColumns: []*schema.Column{GeneralLedgerAccountsColumns[0]}, OnDelete: schema.Cascade, }, }, Indexes: []*schema.Index{ { Name: "divisioncode_code_organization_id", Unique: true, Columns: []*schema.Column{DivisionCodesColumns[5], DivisionCodesColumns[8]}, }, }, } // DocumentClassificationsColumns holds the columns for the "document_classifications" table. DocumentClassificationsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "version", Type: field.TypeInt, Default: 1}, {Name: "status", Type: field.TypeEnum, Enums: []string{"A", "I"}, Default: "A", SchemaType: map[string]string{"postgres": "VARCHAR(1)", "sqlite3": "VARCHAR(1)"}}, {Name: "code", Type: field.TypeString, Size: 10, SchemaType: map[string]string{"postgres": "VARCHAR(10)", "sqlite3": "VARCHAR(10)"}}, {Name: "description", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "color", Type: field.TypeString, Nullable: true}, {Name: "business_unit_id", Type: field.TypeUUID}, {Name: "organization_id", Type: field.TypeUUID}, } // DocumentClassificationsTable holds the schema information for the "document_classifications" table. DocumentClassificationsTable = &schema.Table{ Name: "document_classifications", Columns: DocumentClassificationsColumns, PrimaryKey: []*schema.Column{DocumentClassificationsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "document_classifications_business_units_business_unit", Columns: []*schema.Column{DocumentClassificationsColumns[8]}, RefColumns: []*schema.Column{BusinessUnitsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "document_classifications_organizations_organization", Columns: []*schema.Column{DocumentClassificationsColumns[9]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.Cascade, }, }, Indexes: []*schema.Index{ { Name: "documentclassification_code_organization_id", Unique: true, Columns: []*schema.Column{DocumentClassificationsColumns[5], DocumentClassificationsColumns[9]}, }, }, } // EmailControlsColumns holds the columns for the "email_controls" table. EmailControlsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "business_unit_id", Type: field.TypeUUID}, {Name: "billing_email_profile_id", Type: field.TypeUUID, Nullable: true}, {Name: "rate_expirtation_email_profile_id", Type: field.TypeUUID, Nullable: true}, {Name: "organization_id", Type: field.TypeUUID, Unique: true}, } // EmailControlsTable holds the schema information for the "email_controls" table. EmailControlsTable = &schema.Table{ Name: "email_controls", Columns: EmailControlsColumns, PrimaryKey: []*schema.Column{EmailControlsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "email_controls_business_units_business_unit", Columns: []*schema.Column{EmailControlsColumns[3]}, RefColumns: []*schema.Column{BusinessUnitsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "email_controls_email_profiles_billing_email_profile", Columns: []*schema.Column{EmailControlsColumns[4]}, RefColumns: []*schema.Column{EmailProfilesColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "email_controls_email_profiles_rate_email_profile", Columns: []*schema.Column{EmailControlsColumns[5]}, RefColumns: []*schema.Column{EmailProfilesColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "email_controls_organizations_email_control", Columns: []*schema.Column{EmailControlsColumns[6]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.NoAction, }, }, } // EmailProfilesColumns holds the columns for the "email_profiles" table. EmailProfilesColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "version", Type: field.TypeInt, Default: 1}, {Name: "name", Type: field.TypeString, Size: 150, SchemaType: map[string]string{"postgres": "VARCHAR(150)", "sqlite3": "VARCHAR(150)"}}, {Name: "email", Type: field.TypeString}, {Name: "protocol", Type: field.TypeEnum, Nullable: true, Enums: []string{"TLS", "SSL", "UNENCRYPTED"}, SchemaType: map[string]string{"postgres": "VARCHAR(11)", "sqlite3": "VARCHAR(11)"}}, {Name: "host", Type: field.TypeString, Nullable: true}, {Name: "port", Type: field.TypeInt16, Nullable: true}, {Name: "username", Type: field.TypeString, Nullable: true}, {Name: "password", Type: field.TypeString, Nullable: true}, {Name: "is_default", Type: field.TypeBool, Default: false}, {Name: "business_unit_id", Type: field.TypeUUID}, {Name: "organization_id", Type: field.TypeUUID}, } // EmailProfilesTable holds the schema information for the "email_profiles" table. EmailProfilesTable = &schema.Table{ Name: "email_profiles", Columns: EmailProfilesColumns, PrimaryKey: []*schema.Column{EmailProfilesColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "email_profiles_business_units_business_unit", Columns: []*schema.Column{EmailProfilesColumns[12]}, RefColumns: []*schema.Column{BusinessUnitsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "email_profiles_organizations_organization", Columns: []*schema.Column{EmailProfilesColumns[13]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.Cascade, }, }, } // EquipmentManufactuersColumns holds the columns for the "equipment_manufactuers" table. EquipmentManufactuersColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "version", Type: field.TypeInt, Default: 1}, {Name: "status", Type: field.TypeEnum, Enums: []string{"A", "I"}, Default: "A", SchemaType: map[string]string{"postgres": "VARCHAR(1)", "sqlite3": "VARCHAR(1)"}}, {Name: "name", Type: field.TypeString}, {Name: "description", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "business_unit_id", Type: field.TypeUUID}, {Name: "organization_id", Type: field.TypeUUID}, } // EquipmentManufactuersTable holds the schema information for the "equipment_manufactuers" table. EquipmentManufactuersTable = &schema.Table{ Name: "equipment_manufactuers", Columns: EquipmentManufactuersColumns, PrimaryKey: []*schema.Column{EquipmentManufactuersColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "equipment_manufactuers_business_units_business_unit", Columns: []*schema.Column{EquipmentManufactuersColumns[7]}, RefColumns: []*schema.Column{BusinessUnitsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "equipment_manufactuers_organizations_organization", Columns: []*schema.Column{EquipmentManufactuersColumns[8]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.Cascade, }, }, Indexes: []*schema.Index{ { Name: "equipmentmanufactuer_name_organization_id", Unique: true, Columns: []*schema.Column{EquipmentManufactuersColumns[5], EquipmentManufactuersColumns[8]}, }, }, } // EquipmentTypesColumns holds the columns for the "equipment_types" table. EquipmentTypesColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "version", Type: field.TypeInt, Default: 1}, {Name: "status", Type: field.TypeEnum, Enums: []string{"A", "I"}, Default: "A"}, {Name: "code", Type: field.TypeString, Size: 10, SchemaType: map[string]string{"postgres": "VARCHAR(10)", "sqlite3": "VARCHAR(10)"}}, {Name: "description", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "cost_per_mile", Type: field.TypeFloat64, Nullable: true, SchemaType: map[string]string{"mysql": "decimal(10,2)", "postgres": "numeric(10,2)"}}, {Name: "equipment_class", Type: field.TypeEnum, Enums: []string{"Undefined", "Car", "Van", "Pickup", "Straight", "Tractor", "Trailer", "Container", "Chassis", "Other"}, Default: "Undefined", SchemaType: map[string]string{"postgres": "VARCHAR(10)", "sqlite3": "VARCHAR(10)"}}, {Name: "fixed_cost", Type: field.TypeFloat64, Nullable: true, SchemaType: map[string]string{"mysql": "decimal(10,2)", "postgres": "numeric(10,2)"}}, {Name: "variable_cost", Type: field.TypeFloat64, Nullable: true, SchemaType: map[string]string{"mysql": "decimal(10,2)", "postgres": "numeric(10,2)"}}, {Name: "height", Type: field.TypeFloat64, Nullable: true, SchemaType: map[string]string{"mysql": "decimal(10,2)", "postgres": "numeric(10,2)"}}, {Name: "length", Type: field.TypeFloat64, Nullable: true, SchemaType: map[string]string{"mysql": "decimal(10,2)", "postgres": "numeric(10,2)"}}, {Name: "width", Type: field.TypeFloat64, Nullable: true, SchemaType: map[string]string{"mysql": "decimal(10,2)", "postgres": "numeric(10,2)"}}, {Name: "weight", Type: field.TypeFloat64, Nullable: true, SchemaType: map[string]string{"mysql": "decimal(10,2)", "postgres": "numeric(10,2)"}}, {Name: "idling_fuel_usage", Type: field.TypeFloat64, Nullable: true, SchemaType: map[string]string{"mysql": "decimal(10,2)", "postgres": "numeric(10,2)"}}, {Name: "exempt_from_tolls", Type: field.TypeBool, Default: false}, {Name: "color", Type: field.TypeString, Nullable: true}, {Name: "business_unit_id", Type: field.TypeUUID}, {Name: "organization_id", Type: field.TypeUUID}, } // EquipmentTypesTable holds the schema information for the "equipment_types" table. EquipmentTypesTable = &schema.Table{ Name: "equipment_types", Columns: EquipmentTypesColumns, PrimaryKey: []*schema.Column{EquipmentTypesColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "equipment_types_business_units_business_unit", Columns: []*schema.Column{EquipmentTypesColumns[18]}, RefColumns: []*schema.Column{BusinessUnitsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "equipment_types_organizations_organization", Columns: []*schema.Column{EquipmentTypesColumns[19]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.Cascade, }, }, Indexes: []*schema.Index{ { Name: "equipmenttype_code_organization_id", Unique: true, Columns: []*schema.Column{EquipmentTypesColumns[5], EquipmentTypesColumns[19]}, }, }, } // FeasibilityToolControlsColumns holds the columns for the "feasibility_tool_controls" table. FeasibilityToolControlsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "otp_operator", Type: field.TypeEnum, Enums: []string{"Eq", "Ne", "Gt", "Gte", "Lt", "Lte"}, Default: "Eq"}, {Name: "otp_value", Type: field.TypeFloat64, Default: 100}, {Name: "mpw_operator", Type: field.TypeEnum, Enums: []string{"Eq", "Ne", "Gt", "Gte", "Lt", "Lte"}, Default: "Eq"}, {Name: "mpw_value", Type: field.TypeFloat64, Default: 100}, {Name: "mpd_operator", Type: field.TypeEnum, Enums: []string{"Eq", "Ne", "Gt", "Gte", "Lt", "Lte"}, Default: "Eq"}, {Name: "mpd_value", Type: field.TypeFloat64, Default: 100}, {Name: "mpg_operator", Type: field.TypeEnum, Enums: []string{"Eq", "Ne", "Gt", "Gte", "Lt", "Lte"}, Default: "Eq"}, {Name: "mpg_value", Type: field.TypeFloat64, Default: 100}, {Name: "business_unit_id", Type: field.TypeUUID}, {Name: "organization_id", Type: field.TypeUUID, Unique: true}, } // FeasibilityToolControlsTable holds the schema information for the "feasibility_tool_controls" table. FeasibilityToolControlsTable = &schema.Table{ Name: "feasibility_tool_controls", Columns: FeasibilityToolControlsColumns, PrimaryKey: []*schema.Column{FeasibilityToolControlsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "feasibility_tool_controls_business_units_business_unit", Columns: []*schema.Column{FeasibilityToolControlsColumns[11]}, RefColumns: []*schema.Column{BusinessUnitsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "feasibility_tool_controls_organizations_feasibility_tool_control", Columns: []*schema.Column{FeasibilityToolControlsColumns[12]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.NoAction, }, }, } // FeatureFlagsColumns holds the columns for the "feature_flags" table. FeatureFlagsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "name", Type: field.TypeString}, {Name: "code", Type: field.TypeString, Unique: true, Size: 30, SchemaType: map[string]string{"postgres": "VARCHAR(30)", "sqlite3": "VARCHAR(30)"}}, {Name: "beta", Type: field.TypeBool, Default: false}, {Name: "description", Type: field.TypeString, Size: 2147483647}, {Name: "preview_picture_url", Type: field.TypeString, Nullable: true}, } // FeatureFlagsTable holds the schema information for the "feature_flags" table. FeatureFlagsTable = &schema.Table{ Name: "feature_flags", Comment: "Internal table for storing the feature flags available for Trenova", Columns: FeatureFlagsColumns, PrimaryKey: []*schema.Column{FeatureFlagsColumns[0]}, } // FleetCodesColumns holds the columns for the "fleet_codes" table. FleetCodesColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "version", Type: field.TypeInt, Default: 1}, {Name: "status", Type: field.TypeEnum, Enums: []string{"A", "I"}, Default: "A"}, {Name: "code", Type: field.TypeString, Size: 10}, {Name: "description", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "revenue_goal", Type: field.TypeFloat64, Nullable: true, SchemaType: map[string]string{"mysql": "decimal(10,2)", "postgres": "numeric(10,2)"}}, {Name: "deadhead_goal", Type: field.TypeFloat64, Nullable: true, SchemaType: map[string]string{"mysql": "decimal(10,2)", "postgres": "numeric(10,2)"}}, {Name: "mileage_goal", Type: field.TypeFloat64, Nullable: true, SchemaType: map[string]string{"mysql": "decimal(10,2)", "postgres": "numeric(10,2)"}}, {Name: "business_unit_id", Type: field.TypeUUID}, {Name: "organization_id", Type: field.TypeUUID}, {Name: "manager_id", Type: field.TypeUUID, Nullable: true}, } // FleetCodesTable holds the schema information for the "fleet_codes" table. FleetCodesTable = &schema.Table{ Name: "fleet_codes", Columns: FleetCodesColumns, PrimaryKey: []*schema.Column{FleetCodesColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "fleet_codes_business_units_business_unit", Columns: []*schema.Column{FleetCodesColumns[10]}, RefColumns: []*schema.Column{BusinessUnitsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "fleet_codes_organizations_organization", Columns: []*schema.Column{FleetCodesColumns[11]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "fleet_codes_users_manager", Columns: []*schema.Column{FleetCodesColumns[12]}, RefColumns: []*schema.Column{UsersColumns[0]}, OnDelete: schema.SetNull, }, }, Indexes: []*schema.Index{ { Name: "fleetcode_code_organization_id", Unique: true, Columns: []*schema.Column{FleetCodesColumns[5], FleetCodesColumns[11]}, }, }, } // GeneralLedgerAccountsColumns holds the columns for the "general_ledger_accounts" table. GeneralLedgerAccountsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "version", Type: field.TypeInt, Default: 1}, {Name: "status", Type: field.TypeEnum, Enums: []string{"A", "I"}, Default: "A", SchemaType: map[string]string{"postgres": "VARCHAR(1)", "sqlite3": "VARCHAR(1)"}}, {Name: "account_number", Type: field.TypeString, Size: 7, SchemaType: map[string]string{"postgres": "VARCHAR(7)", "sqlite3": "VARCHAR(7)"}}, {Name: "account_type", Type: field.TypeEnum, Enums: []string{"Asset", "Liability", "Equity", "Revenue", "Expense"}, SchemaType: map[string]string{"postgres": "VARCHAR(9)", "sqlite3": "VARCHAR(9)"}}, {Name: "cash_flow_type", Type: field.TypeString, Nullable: true}, {Name: "account_sub_type", Type: field.TypeString, Nullable: true}, {Name: "account_class", Type: field.TypeString, Nullable: true}, {Name: "balance", Type: field.TypeFloat64, Nullable: true}, {Name: "interest_rate", Type: field.TypeFloat64, Nullable: true}, {Name: "date_opened", Type: field.TypeOther, SchemaType: map[string]string{"postgres": "date", "sqlite3": "date"}}, {Name: "date_closed", Type: field.TypeOther, Nullable: true, SchemaType: map[string]string{"postgres": "date", "sqlite3": "date"}}, {Name: "notes", Type: field.TypeString, Nullable: true}, {Name: "is_tax_relevant", Type: field.TypeBool, Default: false}, {Name: "is_reconciled", Type: field.TypeBool, Default: false}, {Name: "business_unit_id", Type: field.TypeUUID}, {Name: "organization_id", Type: field.TypeUUID}, } // GeneralLedgerAccountsTable holds the schema information for the "general_ledger_accounts" table. GeneralLedgerAccountsTable = &schema.Table{ Name: "general_ledger_accounts", Columns: GeneralLedgerAccountsColumns, PrimaryKey: []*schema.Column{GeneralLedgerAccountsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "general_ledger_accounts_business_units_business_unit", Columns: []*schema.Column{GeneralLedgerAccountsColumns[17]}, RefColumns: []*schema.Column{BusinessUnitsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "general_ledger_accounts_organizations_organization", Columns: []*schema.Column{GeneralLedgerAccountsColumns[18]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.Cascade, }, }, Indexes: []*schema.Index{ { Name: "generalledgeraccount_account_number_organization_id", Unique: true, Columns: []*schema.Column{GeneralLedgerAccountsColumns[5], GeneralLedgerAccountsColumns[18]}, }, }, } // GoogleApisColumns holds the columns for the "google_apis" table. GoogleApisColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "api_key", Type: field.TypeString, Unique: true}, {Name: "mileage_unit", Type: field.TypeEnum, Enums: []string{"Imperial", "Metric"}, Default: "Imperial"}, {Name: "add_customer_location", Type: field.TypeBool, Default: false}, {Name: "auto_geocode", Type: field.TypeBool, Default: false}, {Name: "add_location", Type: field.TypeBool, Default: false}, {Name: "traffic_model", Type: field.TypeEnum, Enums: []string{"BestGuess", "Optimistic", "Pessimistic"}, Default: "BestGuess"}, {Name: "business_unit_id", Type: field.TypeUUID}, {Name: "organization_id", Type: field.TypeUUID, Unique: true}, } // GoogleApisTable holds the schema information for the "google_apis" table. GoogleApisTable = &schema.Table{ Name: "google_apis", Columns: GoogleApisColumns, PrimaryKey: []*schema.Column{GoogleApisColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "google_apis_business_units_business_unit", Columns: []*schema.Column{GoogleApisColumns[9]}, RefColumns: []*schema.Column{BusinessUnitsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "google_apis_organizations_google_api", Columns: []*schema.Column{GoogleApisColumns[10]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.NoAction, }, }, } // HazardousMaterialsColumns holds the columns for the "hazardous_materials" table. HazardousMaterialsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "version", Type: field.TypeInt, Default: 1}, {Name: "status", Type: field.TypeEnum, Enums: []string{"A", "I"}, Default: "A"}, {Name: "name", Type: field.TypeString, Size: 100, SchemaType: map[string]string{"postgres": "VARCHAR(100)", "sqlite3": "VARCHAR(100)"}}, {Name: "hazard_class", Type: field.TypeEnum, Enums: []string{"HazardClass1And1", "HazardClass1And2", "HazardClass1And3", "HazardClass1And4", "HazardClass1And5", "HazardClass1And6", "HazardClass2And1", "HazardClass2And2", "HazardClass2And3", "HazardClass3", "HazardClass4And1", "HazardClass4And2", "HazardClass4And3", "HazardClass5And1", "HazardClass5And2", "HazardClass6And1", "HazardClass6And2", "HazardClass7", "HazardClass8", "HazardClass9"}, Default: "HazardClass1And1", SchemaType: map[string]string{"postgres": "VARCHAR(16)", "sqlite3": "VARCHAR(16)"}}, {Name: "erg_number", Type: field.TypeString, Nullable: true}, {Name: "description", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "packing_group", Type: field.TypeString, Nullable: true}, {Name: "proper_shipping_name", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "business_unit_id", Type: field.TypeUUID}, {Name: "organization_id", Type: field.TypeUUID}, } // HazardousMaterialsTable holds the schema information for the "hazardous_materials" table. HazardousMaterialsTable = &schema.Table{ Name: "hazardous_materials", Columns: HazardousMaterialsColumns, PrimaryKey: []*schema.Column{HazardousMaterialsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "hazardous_materials_business_units_business_unit", Columns: []*schema.Column{HazardousMaterialsColumns[11]}, RefColumns: []*schema.Column{BusinessUnitsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "hazardous_materials_organizations_organization", Columns: []*schema.Column{HazardousMaterialsColumns[12]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.Cascade, }, }, } // HazardousMaterialSegregationsColumns holds the columns for the "hazardous_material_segregations" table. HazardousMaterialSegregationsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "version", Type: field.TypeInt, Default: 1}, {Name: "class_a", Type: field.TypeEnum, Enums: []string{"HazardClass1And1", "HazardClass1And2", "HazardClass1And3", "HazardClass1And4", "HazardClass1And5", "HazardClass1And6", "HazardClass2And1", "HazardClass2And2", "HazardClass2And3", "HazardClass3", "HazardClass4And1", "HazardClass4And2", "HazardClass4And3", "HazardClass5And1", "HazardClass5And2", "HazardClass6And1", "HazardClass6And2", "HazardClass7", "HazardClass8", "HazardClass9"}, Default: "HazardClass1And1", SchemaType: map[string]string{"postgres": "VARCHAR(16)", "sqlite3": "VARCHAR(16)"}}, {Name: "class_b", Type: field.TypeEnum, Enums: []string{"HazardClass1And1", "HazardClass1And2", "HazardClass1And3", "HazardClass1And4", "HazardClass1And5", "HazardClass1And6", "HazardClass2And1", "HazardClass2And2", "HazardClass2And3", "HazardClass3", "HazardClass4And1", "HazardClass4And2", "HazardClass4And3", "HazardClass5And1", "HazardClass5And2", "HazardClass6And1", "HazardClass6And2", "HazardClass7", "HazardClass8", "HazardClass9"}, Default: "HazardClass1And1", SchemaType: map[string]string{"postgres": "VARCHAR(16)", "sqlite3": "VARCHAR(16)"}}, {Name: "segregation_type", Type: field.TypeEnum, Enums: []string{"NotAllowed", "AllowedWithConditions"}, Default: "NotAllowed", SchemaType: map[string]string{"postgres": "VARCHAR(21)", "sqlite3": "VARCHAR(21)"}}, {Name: "business_unit_id", Type: field.TypeUUID}, {Name: "organization_id", Type: field.TypeUUID}, } // HazardousMaterialSegregationsTable holds the schema information for the "hazardous_material_segregations" table. HazardousMaterialSegregationsTable = &schema.Table{ Name: "hazardous_material_segregations", Columns: HazardousMaterialSegregationsColumns, PrimaryKey: []*schema.Column{HazardousMaterialSegregationsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "hazardous_material_segregations_business_units_business_unit", Columns: []*schema.Column{HazardousMaterialSegregationsColumns[7]}, RefColumns: []*schema.Column{BusinessUnitsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "hazardous_material_segregations_organizations_organization", Columns: []*schema.Column{HazardousMaterialSegregationsColumns[8]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.Cascade, }, }, Indexes: []*schema.Index{ { Name: "hazardousmaterialsegregation_class_a_class_b_organization_id", Unique: true, Columns: []*schema.Column{HazardousMaterialSegregationsColumns[4], HazardousMaterialSegregationsColumns[5], HazardousMaterialSegregationsColumns[8]}, }, }, } // InvoiceControlsColumns holds the columns for the "invoice_controls" table. InvoiceControlsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "invoice_number_prefix", Type: field.TypeString, Size: 10, Default: "INV-", SchemaType: map[string]string{"postgres": "VARCHAR(10)", "sqlite3": "VARCHAR(10)"}}, {Name: "credit_memo_number_prefix", Type: field.TypeString, Size: 10, Default: "CM-", SchemaType: map[string]string{"postgres": "VARCHAR(10)", "sqlite3": "VARCHAR(10)"}}, {Name: "invoice_terms", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "invoice_footer", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "invoice_logo_url", Type: field.TypeString, Nullable: true}, {Name: "invoice_date_format", Type: field.TypeEnum, Enums: []string{"InvoiceDateFormatMDY", "InvoiceDateFormatDMY", "InvoiceDateFormatYMD", "InvoiceDateFormatYDM"}, Default: "InvoiceDateFormatMDY"}, {Name: "invoice_due_after_days", Type: field.TypeUint8, Default: 30}, {Name: "invoice_logo_width", Type: field.TypeUint16, Default: 100}, {Name: "show_amount_due", Type: field.TypeBool, Default: true}, {Name: "attach_pdf", Type: field.TypeBool, Default: true}, {Name: "show_invoice_due_date", Type: field.TypeBool, Default: true}, {Name: "business_unit_id", Type: field.TypeUUID}, {Name: "organization_id", Type: field.TypeUUID, Unique: true}, } // InvoiceControlsTable holds the schema information for the "invoice_controls" table. InvoiceControlsTable = &schema.Table{ Name: "invoice_controls", Columns: InvoiceControlsColumns, PrimaryKey: []*schema.Column{InvoiceControlsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "invoice_controls_business_units_business_unit", Columns: []*schema.Column{InvoiceControlsColumns[14]}, RefColumns: []*schema.Column{BusinessUnitsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "invoice_controls_organizations_invoice_control", Columns: []*schema.Column{InvoiceControlsColumns[15]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.NoAction, }, }, } // LocationsColumns holds the columns for the "locations" table. LocationsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "version", Type: field.TypeInt, Default: 1}, {Name: "status", Type: field.TypeEnum, Enums: []string{"A", "I"}, Default: "A"}, {Name: "code", Type: field.TypeString, Size: 10}, {Name: "name", Type: field.TypeString}, {Name: "description", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "address_line_1", Type: field.TypeString, Size: 150, SchemaType: map[string]string{"postgres": "VARCHAR(150)", "sqlite3": "VARCHAR(150)"}}, {Name: "address_line_2", Type: field.TypeString, Nullable: true, Size: 150, SchemaType: map[string]string{"postgres": "VARCHAR(150)", "sqlite3": "VARCHAR(150)"}}, {Name: "city", Type: field.TypeString, Size: 150, SchemaType: map[string]string{"postgres": "VARCHAR(150)", "sqlite3": "VARCHAR(150)"}}, {Name: "postal_code", Type: field.TypeString, Size: 10, SchemaType: map[string]string{"postgres": "VARCHAR(10)", "sqlite3": "VARCHAR(10)"}}, {Name: "longitude", Type: field.TypeFloat64, Nullable: true}, {Name: "latitude", Type: field.TypeFloat64, Nullable: true}, {Name: "place_id", Type: field.TypeString, Nullable: true, Size: 255, SchemaType: map[string]string{"postgres": "VARCHAR(255)", "sqlite3": "VARCHAR(255)"}}, {Name: "is_geocoded", Type: field.TypeBool, Default: false}, {Name: "business_unit_id", Type: field.TypeUUID}, {Name: "organization_id", Type: field.TypeUUID}, {Name: "location_category_id", Type: field.TypeUUID, Nullable: true}, {Name: "state_id", Type: field.TypeUUID}, } // LocationsTable holds the schema information for the "locations" table. LocationsTable = &schema.Table{ Name: "locations", Columns: LocationsColumns, PrimaryKey: []*schema.Column{LocationsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "locations_business_units_business_unit", Columns: []*schema.Column{LocationsColumns[16]}, RefColumns: []*schema.Column{BusinessUnitsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "locations_organizations_organization", Columns: []*schema.Column{LocationsColumns[17]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "locations_location_categories_location_category", Columns: []*schema.Column{LocationsColumns[18]}, RefColumns: []*schema.Column{LocationCategoriesColumns[0]}, OnDelete: schema.SetNull, }, { Symbol: "locations_us_states_state", Columns: []*schema.Column{LocationsColumns[19]}, RefColumns: []*schema.Column{UsStatesColumns[0]}, OnDelete: schema.Cascade, }, }, Indexes: []*schema.Index{ { Name: "location_code_organization_id", Unique: true, Columns: []*schema.Column{LocationsColumns[5], LocationsColumns[17]}, }, }, } // LocationCategoriesColumns holds the columns for the "location_categories" table. LocationCategoriesColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "version", Type: field.TypeInt, Default: 1}, {Name: "name", Type: field.TypeString, Size: 100, SchemaType: map[string]string{"postgres": "VARCHAR(100)", "sqlite3": "VARCHAR(100)"}}, {Name: "description", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "color", Type: field.TypeString, Nullable: true}, {Name: "business_unit_id", Type: field.TypeUUID}, {Name: "organization_id", Type: field.TypeUUID}, } // LocationCategoriesTable holds the schema information for the "location_categories" table. LocationCategoriesTable = &schema.Table{ Name: "location_categories", Columns: LocationCategoriesColumns, PrimaryKey: []*schema.Column{LocationCategoriesColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "location_categories_business_units_business_unit", Columns: []*schema.Column{LocationCategoriesColumns[7]}, RefColumns: []*schema.Column{BusinessUnitsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "location_categories_organizations_organization", Columns: []*schema.Column{LocationCategoriesColumns[8]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.Cascade, }, }, Indexes: []*schema.Index{ { Name: "locationcategory_name_organization_id", Unique: true, Columns: []*schema.Column{LocationCategoriesColumns[4], LocationCategoriesColumns[8]}, }, }, } // LocationCommentsColumns holds the columns for the "location_comments" table. LocationCommentsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "version", Type: field.TypeInt, Default: 1}, {Name: "comment", Type: field.TypeString, Size: 2147483647}, {Name: "location_id", Type: field.TypeUUID}, {Name: "business_unit_id", Type: field.TypeUUID}, {Name: "organization_id", Type: field.TypeUUID}, {Name: "user_id", Type: field.TypeUUID}, {Name: "comment_type_id", Type: field.TypeUUID}, } // LocationCommentsTable holds the schema information for the "location_comments" table. LocationCommentsTable = &schema.Table{ Name: "location_comments", Columns: LocationCommentsColumns, PrimaryKey: []*schema.Column{LocationCommentsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "location_comments_locations_comments", Columns: []*schema.Column{LocationCommentsColumns[5]}, RefColumns: []*schema.Column{LocationsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "location_comments_business_units_business_unit", Columns: []*schema.Column{LocationCommentsColumns[6]}, RefColumns: []*schema.Column{BusinessUnitsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "location_comments_organizations_organization", Columns: []*schema.Column{LocationCommentsColumns[7]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "location_comments_users_user", Columns: []*schema.Column{LocationCommentsColumns[8]}, RefColumns: []*schema.Column{UsersColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "location_comments_comment_types_comment_type", Columns: []*schema.Column{LocationCommentsColumns[9]}, RefColumns: []*schema.Column{CommentTypesColumns[0]}, OnDelete: schema.NoAction, }, }, } // LocationContactsColumns holds the columns for the "location_contacts" table. LocationContactsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "version", Type: field.TypeInt, Default: 1}, {Name: "name", Type: field.TypeString}, {Name: "email_address", Type: field.TypeString, Nullable: true}, {Name: "phone_number", Type: field.TypeString, Nullable: true, Size: 15, SchemaType: map[string]string{"postgres": "VARCHAR(15)", "sqlite3": "VARCHAR(15)"}}, {Name: "location_id", Type: field.TypeUUID}, {Name: "business_unit_id", Type: field.TypeUUID}, {Name: "organization_id", Type: field.TypeUUID}, } // LocationContactsTable holds the schema information for the "location_contacts" table. LocationContactsTable = &schema.Table{ Name: "location_contacts", Columns: LocationContactsColumns, PrimaryKey: []*schema.Column{LocationContactsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "location_contacts_locations_contacts", Columns: []*schema.Column{LocationContactsColumns[7]}, RefColumns: []*schema.Column{LocationsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "location_contacts_business_units_business_unit", Columns: []*schema.Column{LocationContactsColumns[8]}, RefColumns: []*schema.Column{BusinessUnitsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "location_contacts_organizations_organization", Columns: []*schema.Column{LocationContactsColumns[9]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.Cascade, }, }, } // OrganizationsColumns holds the columns for the "organizations" table. OrganizationsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "name", Type: field.TypeString, Size: 100, SchemaType: map[string]string{"postgres": "VARCHAR(100)", "sqlite3": "VARCHAR(100)"}}, {Name: "scac_code", Type: field.TypeString, Size: 4, SchemaType: map[string]string{"postgres": "VARCHAR(4)", "sqlite3": "VARCHAR(4)"}}, {Name: "dot_number", Type: field.TypeString, Size: 12, SchemaType: map[string]string{"postgres": "VARCHAR(12)", "sqlite3": "VARCHAR(12)"}}, {Name: "logo_url", Type: field.TypeString, Nullable: true}, {Name: "org_type", Type: field.TypeEnum, Enums: []string{"A", "B", "X"}, Default: "A", SchemaType: map[string]string{"postgres": "VARCHAR(1)", "sqlite3": "VARCHAR(1)"}}, {Name: "timezone", Type: field.TypeEnum, Enums: []string{"AmericaLosAngeles", "AmericaDenver", "AmericaChicago", "AmericaNewYork"}, Default: "AmericaLosAngeles", SchemaType: map[string]string{"postgres": "VARCHAR(17)", "sqlite3": "VARCHAR(17)"}}, {Name: "business_unit_id", Type: field.TypeUUID}, } // OrganizationsTable holds the schema information for the "organizations" table. OrganizationsTable = &schema.Table{ Name: "organizations", Columns: OrganizationsColumns, PrimaryKey: []*schema.Column{OrganizationsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "organizations_business_units_organizations", Columns: []*schema.Column{OrganizationsColumns[9]}, RefColumns: []*schema.Column{BusinessUnitsColumns[0]}, OnDelete: schema.Cascade, }, }, } // OrganizationFeatureFlagsColumns holds the columns for the "organization_feature_flags" table. OrganizationFeatureFlagsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "is_enabled", Type: field.TypeBool, Default: true}, {Name: "feature_flag_id", Type: field.TypeUUID}, {Name: "organization_id", Type: field.TypeUUID}, } // OrganizationFeatureFlagsTable holds the schema information for the "organization_feature_flags" table. OrganizationFeatureFlagsTable = &schema.Table{ Name: "organization_feature_flags", Columns: OrganizationFeatureFlagsColumns, PrimaryKey: []*schema.Column{OrganizationFeatureFlagsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "organization_feature_flags_feature_flags_feature_flag", Columns: []*schema.Column{OrganizationFeatureFlagsColumns[4]}, RefColumns: []*schema.Column{FeatureFlagsColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "organization_feature_flags_organizations_organization", Columns: []*schema.Column{OrganizationFeatureFlagsColumns[5]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "organizationfeatureflag_organization_id_feature_flag_id", Unique: true, Columns: []*schema.Column{OrganizationFeatureFlagsColumns[5], OrganizationFeatureFlagsColumns[4]}, }, }, } // QualifierCodesColumns holds the columns for the "qualifier_codes" table. QualifierCodesColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "version", Type: field.TypeInt, Default: 1}, {Name: "status", Type: field.TypeEnum, Enums: []string{"A", "I"}, Default: "A", SchemaType: map[string]string{"postgres": "VARCHAR(1)", "sqlite3": "VARCHAR(1)"}}, {Name: "code", Type: field.TypeString, Size: 10, SchemaType: map[string]string{"postgres": "VARCHAR(10)", "sqlite3": "VARCHAR(10)"}}, {Name: "description", Type: field.TypeString, Size: 2147483647}, {Name: "business_unit_id", Type: field.TypeUUID}, {Name: "organization_id", Type: field.TypeUUID}, } // QualifierCodesTable holds the schema information for the "qualifier_codes" table. QualifierCodesTable = &schema.Table{ Name: "qualifier_codes", Columns: QualifierCodesColumns, PrimaryKey: []*schema.Column{QualifierCodesColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "qualifier_codes_business_units_business_unit", Columns: []*schema.Column{QualifierCodesColumns[7]}, RefColumns: []*schema.Column{BusinessUnitsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "qualifier_codes_organizations_organization", Columns: []*schema.Column{QualifierCodesColumns[8]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.Cascade, }, }, Indexes: []*schema.Index{ { Name: "qualifiercode_code_organization_id", Unique: true, Columns: []*schema.Column{QualifierCodesColumns[5], QualifierCodesColumns[8]}, }, }, } // ReasonCodesColumns holds the columns for the "reason_codes" table. ReasonCodesColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "version", Type: field.TypeInt, Default: 1}, {Name: "status", Type: field.TypeEnum, Enums: []string{"A", "I"}, Default: "A", SchemaType: map[string]string{"postgres": "VARCHAR(1)", "sqlite3": "VARCHAR(1)"}}, {Name: "code", Type: field.TypeString, Size: 10, SchemaType: map[string]string{"postgres": "VARCHAR(10)", "sqlite3": "VARCHAR(10)"}}, {Name: "code_type", Type: field.TypeEnum, Enums: []string{"Voided", "Cancelled"}}, {Name: "description", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "business_unit_id", Type: field.TypeUUID}, {Name: "organization_id", Type: field.TypeUUID}, } // ReasonCodesTable holds the schema information for the "reason_codes" table. ReasonCodesTable = &schema.Table{ Name: "reason_codes", Columns: ReasonCodesColumns, PrimaryKey: []*schema.Column{ReasonCodesColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "reason_codes_business_units_business_unit", Columns: []*schema.Column{ReasonCodesColumns[8]}, RefColumns: []*schema.Column{BusinessUnitsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "reason_codes_organizations_organization", Columns: []*schema.Column{ReasonCodesColumns[9]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.Cascade, }, }, Indexes: []*schema.Index{ { Name: "reasoncode_code_organization_id", Unique: true, Columns: []*schema.Column{ReasonCodesColumns[5], ReasonCodesColumns[9]}, }, }, } // RevenueCodesColumns holds the columns for the "revenue_codes" table. RevenueCodesColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "version", Type: field.TypeInt, Default: 1}, {Name: "status", Type: field.TypeEnum, Enums: []string{"A", "I"}, Default: "A", SchemaType: map[string]string{"postgres": "VARCHAR(1)", "sqlite3": "VARCHAR(1)"}}, {Name: "code", Type: field.TypeString, Size: 4, SchemaType: map[string]string{"postgres": "VARCHAR(4)", "sqlite3": "VARCHAR(4)"}}, {Name: "description", Type: field.TypeString, Size: 2147483647}, {Name: "business_unit_id", Type: field.TypeUUID}, {Name: "organization_id", Type: field.TypeUUID}, {Name: "expense_account_id", Type: field.TypeUUID, Nullable: true}, {Name: "revenue_account_id", Type: field.TypeUUID, Nullable: true}, } // RevenueCodesTable holds the schema information for the "revenue_codes" table. RevenueCodesTable = &schema.Table{ Name: "revenue_codes", Columns: RevenueCodesColumns, PrimaryKey: []*schema.Column{RevenueCodesColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "revenue_codes_business_units_business_unit", Columns: []*schema.Column{RevenueCodesColumns[7]}, RefColumns: []*schema.Column{BusinessUnitsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "revenue_codes_organizations_organization", Columns: []*schema.Column{RevenueCodesColumns[8]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "revenue_codes_general_ledger_accounts_expense_account", Columns: []*schema.Column{RevenueCodesColumns[9]}, RefColumns: []*schema.Column{GeneralLedgerAccountsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "revenue_codes_general_ledger_accounts_revenue_account", Columns: []*schema.Column{RevenueCodesColumns[10]}, RefColumns: []*schema.Column{GeneralLedgerAccountsColumns[0]}, OnDelete: schema.Cascade, }, }, Indexes: []*schema.Index{ { Name: "revenuecode_code_organization_id", Unique: true, Columns: []*schema.Column{RevenueCodesColumns[5], RevenueCodesColumns[8]}, }, }, } // RouteControlsColumns holds the columns for the "route_controls" table. RouteControlsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "distance_method", Type: field.TypeEnum, Enums: []string{"T", "G"}, Default: "T", SchemaType: map[string]string{"postgres": "VARCHAR(1)", "sqlite3": "VARCHAR(1)"}}, {Name: "mileage_unit", Type: field.TypeEnum, Enums: []string{"M", "I"}, Default: "M", SchemaType: map[string]string{"postgres": "VARCHAR(1)", "sqlite3": "VARCHAR(1)"}}, {Name: "generate_routes", Type: field.TypeBool, Default: false}, {Name: "organization_id", Type: field.TypeUUID, Unique: true}, {Name: "business_unit_id", Type: field.TypeUUID}, } // RouteControlsTable holds the schema information for the "route_controls" table. RouteControlsTable = &schema.Table{ Name: "route_controls", Columns: RouteControlsColumns, PrimaryKey: []*schema.Column{RouteControlsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "route_controls_organizations_route_control", Columns: []*schema.Column{RouteControlsColumns[6]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "route_controls_business_units_business_unit", Columns: []*schema.Column{RouteControlsColumns[7]}, RefColumns: []*schema.Column{BusinessUnitsColumns[0]}, OnDelete: schema.Cascade, }, }, } // ServiceTypesColumns holds the columns for the "service_types" table. ServiceTypesColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "version", Type: field.TypeInt, Default: 1}, {Name: "status", Type: field.TypeEnum, Enums: []string{"A", "I"}, Default: "A"}, {Name: "code", Type: field.TypeString, Size: 10, SchemaType: map[string]string{"postgres": "VARCHAR(10)", "sqlite3": "VARCHAR(10)"}}, {Name: "description", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "business_unit_id", Type: field.TypeUUID}, {Name: "organization_id", Type: field.TypeUUID}, } // ServiceTypesTable holds the schema information for the "service_types" table. ServiceTypesTable = &schema.Table{ Name: "service_types", Columns: ServiceTypesColumns, PrimaryKey: []*schema.Column{ServiceTypesColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "service_types_business_units_business_unit", Columns: []*schema.Column{ServiceTypesColumns[7]}, RefColumns: []*schema.Column{BusinessUnitsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "service_types_organizations_organization", Columns: []*schema.Column{ServiceTypesColumns[8]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.Cascade, }, }, Indexes: []*schema.Index{ { Name: "servicetype_code_organization_id", Unique: true, Columns: []*schema.Column{ServiceTypesColumns[5], ServiceTypesColumns[8]}, }, }, } // SessionsColumns holds the columns for the "sessions" table. SessionsColumns = []*schema.Column{ {Name: "id", Type: field.TypeString, Unique: true}, {Name: "data", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "expires_at", Type: field.TypeTime}, } // SessionsTable holds the schema information for the "sessions" table. SessionsTable = &schema.Table{ Name: "sessions", Columns: SessionsColumns, PrimaryKey: []*schema.Column{SessionsColumns[0]}, } // ShipmentControlsColumns holds the columns for the "shipment_controls" table. ShipmentControlsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "auto_rate_shipment", Type: field.TypeBool, Default: true}, {Name: "calculate_distance", Type: field.TypeBool, Default: true}, {Name: "enforce_rev_code", Type: field.TypeBool, Default: false}, {Name: "enforce_voided_comm", Type: field.TypeBool, Default: false}, {Name: "generate_routes", Type: field.TypeBool, Default: false}, {Name: "enforce_commodity", Type: field.TypeBool, Default: false}, {Name: "auto_sequence_stops", Type: field.TypeBool, Default: true}, {Name: "auto_shipment_total", Type: field.TypeBool, Default: true}, {Name: "enforce_origin_destination", Type: field.TypeBool, Default: false}, {Name: "check_for_duplicate_bol", Type: field.TypeBool, Default: false}, {Name: "send_placard_info", Type: field.TypeBool, Default: false}, {Name: "enforce_hazmat_seg_rules", Type: field.TypeBool, Default: true}, {Name: "organization_id", Type: field.TypeUUID, Unique: true}, {Name: "business_unit_id", Type: field.TypeUUID}, } // ShipmentControlsTable holds the schema information for the "shipment_controls" table. ShipmentControlsTable = &schema.Table{ Name: "shipment_controls", Columns: ShipmentControlsColumns, PrimaryKey: []*schema.Column{ShipmentControlsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "shipment_controls_organizations_shipment_control", Columns: []*schema.Column{ShipmentControlsColumns[15]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "shipment_controls_business_units_business_unit", Columns: []*schema.Column{ShipmentControlsColumns[16]}, RefColumns: []*schema.Column{BusinessUnitsColumns[0]}, OnDelete: schema.Cascade, }, }, } // ShipmentTypesColumns holds the columns for the "shipment_types" table. ShipmentTypesColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "version", Type: field.TypeInt, Default: 1}, {Name: "status", Type: field.TypeEnum, Enums: []string{"A", "I"}, Default: "A", SchemaType: map[string]string{"postgres": "VARCHAR(1)", "sqlite3": "VARCHAR(1)"}}, {Name: "code", Type: field.TypeString, Size: 10, SchemaType: map[string]string{"postgres": "VARCHAR(10)", "sqlite3": "VARCHAR(10)"}}, {Name: "description", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "business_unit_id", Type: field.TypeUUID}, {Name: "organization_id", Type: field.TypeUUID}, } // ShipmentTypesTable holds the schema information for the "shipment_types" table. ShipmentTypesTable = &schema.Table{ Name: "shipment_types", Columns: ShipmentTypesColumns, PrimaryKey: []*schema.Column{ShipmentTypesColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "shipment_types_business_units_business_unit", Columns: []*schema.Column{ShipmentTypesColumns[7]}, RefColumns: []*schema.Column{BusinessUnitsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "shipment_types_organizations_organization", Columns: []*schema.Column{ShipmentTypesColumns[8]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.Cascade, }, }, Indexes: []*schema.Index{ { Name: "shipmenttype_code_organization_id", Unique: true, Columns: []*schema.Column{ShipmentTypesColumns[5], ShipmentTypesColumns[8]}, }, }, } // TableChangeAlertsColumns holds the columns for the "table_change_alerts" table. TableChangeAlertsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "version", Type: field.TypeInt, Default: 1}, {Name: "status", Type: field.TypeEnum, Enums: []string{"A", "I"}, Default: "A"}, {Name: "name", Type: field.TypeString, Size: 50, SchemaType: map[string]string{"postgres": "VARCHAR(50)", "sqlite3": "VARCHAR(50)"}}, {Name: "database_action", Type: field.TypeEnum, Enums: []string{"Insert", "Update", "Delete", "All"}, SchemaType: map[string]string{"postgres": "VARCHAR(6)", "sqlite3": "VARCHAR(6)"}}, {Name: "source", Type: field.TypeEnum, Enums: []string{"Kafka", "Database"}}, {Name: "table_name", Type: field.TypeString, Nullable: true}, {Name: "topic_name", Type: field.TypeString, Nullable: true}, {Name: "description", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "custom_subject", Type: field.TypeString, Nullable: true}, {Name: "function_name", Type: field.TypeString, Nullable: true, Size: 50, SchemaType: map[string]string{"postgres": "VARCHAR(50)", "sqlite3": "VARCHAR(50)"}}, {Name: "trigger_name", Type: field.TypeString, Nullable: true, Size: 50, SchemaType: map[string]string{"postgres": "VARCHAR(50)", "sqlite3": "VARCHAR(50)"}}, {Name: "listener_name", Type: field.TypeString, Nullable: true, Size: 50, SchemaType: map[string]string{"postgres": "VARCHAR(50)", "sqlite3": "VARCHAR(50)"}}, {Name: "email_recipients", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "effective_date", Type: field.TypeOther, Nullable: true, SchemaType: map[string]string{"postgres": "date", "sqlite3": "date"}}, {Name: "expiration_date", Type: field.TypeOther, Nullable: true, SchemaType: map[string]string{"postgres": "date", "sqlite3": "date"}}, {Name: "business_unit_id", Type: field.TypeUUID}, {Name: "organization_id", Type: field.TypeUUID}, } // TableChangeAlertsTable holds the schema information for the "table_change_alerts" table. TableChangeAlertsTable = &schema.Table{ Name: "table_change_alerts", Columns: TableChangeAlertsColumns, PrimaryKey: []*schema.Column{TableChangeAlertsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "table_change_alerts_business_units_business_unit", Columns: []*schema.Column{TableChangeAlertsColumns[18]}, RefColumns: []*schema.Column{BusinessUnitsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "table_change_alerts_organizations_organization", Columns: []*schema.Column{TableChangeAlertsColumns[19]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.Cascade, }, }, } // TagsColumns holds the columns for the "tags" table. TagsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "version", Type: field.TypeInt, Default: 1}, {Name: "name", Type: field.TypeString, Size: 50, SchemaType: map[string]string{"postgres": "VARCHAR(50)", "sqlite3": "VARCHAR(50)"}}, {Name: "description", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "color", Type: field.TypeString, Nullable: true}, {Name: "business_unit_id", Type: field.TypeUUID}, {Name: "organization_id", Type: field.TypeUUID}, } // TagsTable holds the schema information for the "tags" table. TagsTable = &schema.Table{ Name: "tags", Columns: TagsColumns, PrimaryKey: []*schema.Column{TagsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "tags_business_units_business_unit", Columns: []*schema.Column{TagsColumns[7]}, RefColumns: []*schema.Column{BusinessUnitsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "tags_organizations_organization", Columns: []*schema.Column{TagsColumns[8]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.Cascade, }, }, Indexes: []*schema.Index{ { Name: "tag_name_organization_id", Unique: true, Columns: []*schema.Column{TagsColumns[4], TagsColumns[8]}, }, }, } // TractorsColumns holds the columns for the "tractors" table. TractorsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "version", Type: field.TypeInt, Default: 1}, {Name: "code", Type: field.TypeString, Size: 50, SchemaType: map[string]string{"postgres": "VARCHAR(50)", "sqlite3": "VARCHAR(50)"}}, {Name: "status", Type: field.TypeEnum, Enums: []string{"Available", "OutOfService", "AtMaintenance", "Sold", "Lost"}, Default: "Available", SchemaType: map[string]string{"postgres": "VARCHAR(13)", "sqlite3": "VARCHAR(13)"}}, {Name: "license_plate_number", Type: field.TypeString, Nullable: true, Size: 50, SchemaType: map[string]string{"postgres": "VARCHAR(50)", "sqlite3": "VARCHAR(50)"}}, {Name: "vin", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "VARCHAR(17)", "sqlite3": "VARCHAR(17)"}}, {Name: "model", Type: field.TypeString, Nullable: true, Size: 50, SchemaType: map[string]string{"postgres": "VARCHAR(50)", "sqlite3": "VARCHAR(50)"}}, {Name: "year", Type: field.TypeInt16, Nullable: true}, {Name: "leased", Type: field.TypeBool, Default: false}, {Name: "leased_date", Type: field.TypeOther, Nullable: true, SchemaType: map[string]string{"postgres": "date", "sqlite3": "date"}}, {Name: "business_unit_id", Type: field.TypeUUID}, {Name: "organization_id", Type: field.TypeUUID}, {Name: "equipment_type_id", Type: field.TypeUUID, Nullable: true}, {Name: "equipment_manufacturer_id", Type: field.TypeUUID, Nullable: true}, {Name: "state_id", Type: field.TypeUUID, Nullable: true}, {Name: "fleet_code_id", Type: field.TypeUUID}, {Name: "primary_worker_id", Type: field.TypeUUID, Unique: true}, {Name: "secondary_worker_id", Type: field.TypeUUID, Unique: true, Nullable: true}, } // TractorsTable holds the schema information for the "tractors" table. TractorsTable = &schema.Table{ Name: "tractors", Columns: TractorsColumns, PrimaryKey: []*schema.Column{TractorsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "tractors_business_units_business_unit", Columns: []*schema.Column{TractorsColumns[12]}, RefColumns: []*schema.Column{BusinessUnitsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "tractors_organizations_organization", Columns: []*schema.Column{TractorsColumns[13]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "tractors_equipment_types_equipment_type", Columns: []*schema.Column{TractorsColumns[14]}, RefColumns: []*schema.Column{EquipmentTypesColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "tractors_equipment_manufactuers_equipment_manufacturer", Columns: []*schema.Column{TractorsColumns[15]}, RefColumns: []*schema.Column{EquipmentManufactuersColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "tractors_us_states_state", Columns: []*schema.Column{TractorsColumns[16]}, RefColumns: []*schema.Column{UsStatesColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "tractors_fleet_codes_fleet_code", Columns: []*schema.Column{TractorsColumns[17]}, RefColumns: []*schema.Column{FleetCodesColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "tractors_workers_primary_tractor", Columns: []*schema.Column{TractorsColumns[18]}, RefColumns: []*schema.Column{WorkersColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "tractors_workers_secondary_tractor", Columns: []*schema.Column{TractorsColumns[19]}, RefColumns: []*schema.Column{WorkersColumns[0]}, OnDelete: schema.Cascade, }, }, Indexes: []*schema.Index{ { Name: "tractor_code_organization_id", Unique: true, Columns: []*schema.Column{TractorsColumns[4], TractorsColumns[13]}, }, }, } // TrailersColumns holds the columns for the "trailers" table. TrailersColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "version", Type: field.TypeInt, Default: 1}, {Name: "code", Type: field.TypeString, Size: 50, SchemaType: map[string]string{"postgres": "VARCHAR(50)", "sqlite3": "VARCHAR(50)"}}, {Name: "status", Type: field.TypeEnum, Enums: []string{"Available", "OutOfService", "AtMaintenance", "Sold", "Lost"}, Default: "Available", SchemaType: map[string]string{"postgres": "VARCHAR(13)", "sqlite3": "VARCHAR(13)"}}, {Name: "vin", Type: field.TypeString, Nullable: true, SchemaType: map[string]string{"postgres": "VARCHAR(17)", "sqlite3": "VARCHAR(17)"}}, {Name: "model", Type: field.TypeString, Nullable: true, Size: 50, SchemaType: map[string]string{"postgres": "VARCHAR(50)", "sqlite3": "VARCHAR(50)"}}, {Name: "year", Type: field.TypeInt16, Nullable: true}, {Name: "license_plate_number", Type: field.TypeString, Nullable: true, Size: 50, SchemaType: map[string]string{"postgres": "VARCHAR(50)", "sqlite3": "VARCHAR(50)"}}, {Name: "last_inspection_date", Type: field.TypeOther, Nullable: true, SchemaType: map[string]string{"postgres": "date", "sqlite3": "date"}}, {Name: "registration_number", Type: field.TypeString, Nullable: true}, {Name: "registration_expiration_date", Type: field.TypeOther, Nullable: true, SchemaType: map[string]string{"postgres": "date", "sqlite3": "date"}}, {Name: "business_unit_id", Type: field.TypeUUID}, {Name: "organization_id", Type: field.TypeUUID}, {Name: "equipment_type_id", Type: field.TypeUUID}, {Name: "equipment_manufacturer_id", Type: field.TypeUUID, Nullable: true}, {Name: "state_id", Type: field.TypeUUID, Nullable: true}, {Name: "registration_state_id", Type: field.TypeUUID, Nullable: true}, {Name: "fleet_code_id", Type: field.TypeUUID}, } // TrailersTable holds the schema information for the "trailers" table. TrailersTable = &schema.Table{ Name: "trailers", Columns: TrailersColumns, PrimaryKey: []*schema.Column{TrailersColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "trailers_business_units_business_unit", Columns: []*schema.Column{TrailersColumns[13]}, RefColumns: []*schema.Column{BusinessUnitsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "trailers_organizations_organization", Columns: []*schema.Column{TrailersColumns[14]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "trailers_equipment_types_equipment_type", Columns: []*schema.Column{TrailersColumns[15]}, RefColumns: []*schema.Column{EquipmentTypesColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "trailers_equipment_manufactuers_equipment_manufacturer", Columns: []*schema.Column{TrailersColumns[16]}, RefColumns: []*schema.Column{EquipmentManufactuersColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "trailers_us_states_state", Columns: []*schema.Column{TrailersColumns[17]}, RefColumns: []*schema.Column{UsStatesColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "trailers_us_states_registration_state", Columns: []*schema.Column{TrailersColumns[18]}, RefColumns: []*schema.Column{UsStatesColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "trailers_fleet_codes_fleet_code", Columns: []*schema.Column{TrailersColumns[19]}, RefColumns: []*schema.Column{FleetCodesColumns[0]}, OnDelete: schema.Cascade, }, }, Indexes: []*schema.Index{ { Name: "trailer_code_organization_id", Unique: true, Columns: []*schema.Column{TrailersColumns[4], TrailersColumns[14]}, }, }, } // UsStatesColumns holds the columns for the "us_states" table. UsStatesColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "name", Type: field.TypeString, Size: 255}, {Name: "abbreviation", Type: field.TypeString, Size: 5}, {Name: "country_name", Type: field.TypeString, Size: 255, Default: "United States"}, {Name: "country_iso3", Type: field.TypeString, Size: 3, Default: "USA"}, } // UsStatesTable holds the schema information for the "us_states" table. UsStatesTable = &schema.Table{ Name: "us_states", Columns: UsStatesColumns, PrimaryKey: []*schema.Column{UsStatesColumns[0]}, } // UsersColumns holds the columns for the "users" table. UsersColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "version", Type: field.TypeInt, Default: 1}, {Name: "status", Type: field.TypeEnum, Enums: []string{"A", "I"}, Default: "A", SchemaType: map[string]string{"postgres": "VARCHAR(1)", "sqlite3": "VARCHAR(1)"}}, {Name: "name", Type: field.TypeString}, {Name: "username", Type: field.TypeString, Size: 30}, {Name: "password", Type: field.TypeString, Size: 100}, {Name: "email", Type: field.TypeString}, {Name: "timezone", Type: field.TypeEnum, Enums: []string{"AmericaLosAngeles", "AmericaDenver", "AmericaChicago", "AmericaNewYork"}, Default: "AmericaLosAngeles", SchemaType: map[string]string{"postgres": "VARCHAR(17)", "sqlite3": "VARCHAR(17)"}}, {Name: "profile_pic_url", Type: field.TypeString, Nullable: true}, {Name: "thumbnail_url", Type: field.TypeString, Nullable: true}, {Name: "phone_number", Type: field.TypeString, Nullable: true}, {Name: "is_admin", Type: field.TypeBool, Default: false}, {Name: "is_super_admin", Type: field.TypeBool, Default: false}, {Name: "last_login", Type: field.TypeTime, Nullable: true}, {Name: "business_unit_id", Type: field.TypeUUID}, {Name: "organization_id", Type: field.TypeUUID}, } // UsersTable holds the schema information for the "users" table. UsersTable = &schema.Table{ Name: "users", Columns: UsersColumns, PrimaryKey: []*schema.Column{UsersColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "users_business_units_business_unit", Columns: []*schema.Column{UsersColumns[16]}, RefColumns: []*schema.Column{BusinessUnitsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "users_organizations_organization", Columns: []*schema.Column{UsersColumns[17]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.Cascade, }, }, Indexes: []*schema.Index{ { Name: "user_username_email", Unique: true, Columns: []*schema.Column{UsersColumns[6], UsersColumns[8]}, }, }, } // UserFavoritesColumns holds the columns for the "user_favorites" table. UserFavoritesColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "version", Type: field.TypeInt, Default: 1}, {Name: "page_link", Type: field.TypeString, Unique: true}, {Name: "user_id", Type: field.TypeUUID}, {Name: "business_unit_id", Type: field.TypeUUID}, {Name: "organization_id", Type: field.TypeUUID}, } // UserFavoritesTable holds the schema information for the "user_favorites" table. UserFavoritesTable = &schema.Table{ Name: "user_favorites", Columns: UserFavoritesColumns, PrimaryKey: []*schema.Column{UserFavoritesColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "user_favorites_users_user_favorites", Columns: []*schema.Column{UserFavoritesColumns[5]}, RefColumns: []*schema.Column{UsersColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "user_favorites_business_units_business_unit", Columns: []*schema.Column{UserFavoritesColumns[6]}, RefColumns: []*schema.Column{BusinessUnitsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "user_favorites_organizations_organization", Columns: []*schema.Column{UserFavoritesColumns[7]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.Cascade, }, }, } // WorkersColumns holds the columns for the "workers" table. WorkersColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "version", Type: field.TypeInt, Default: 1}, {Name: "status", Type: field.TypeEnum, Enums: []string{"A", "I"}, Default: "A"}, {Name: "code", Type: field.TypeString, Size: 10, SchemaType: map[string]string{"postgres": "VARCHAR(10)", "sqlite3": "VARCHAR(10)"}}, {Name: "profile_picture_url", Type: field.TypeString, Nullable: true}, {Name: "worker_type", Type: field.TypeEnum, Enums: []string{"Employee", "Contractor"}, Default: "Employee"}, {Name: "first_name", Type: field.TypeString}, {Name: "last_name", Type: field.TypeString}, {Name: "address_line_1", Type: field.TypeString, Nullable: true, Size: 150, SchemaType: map[string]string{"postgres": "VARCHAR(150)", "sqlite3": "VARCHAR(150)"}}, {Name: "address_line_2", Type: field.TypeString, Nullable: true, Size: 150, SchemaType: map[string]string{"postgres": "VARCHAR(150)", "sqlite3": "VARCHAR(150)"}}, {Name: "city", Type: field.TypeString, Nullable: true, Size: 150, SchemaType: map[string]string{"postgres": "VARCHAR(150)", "sqlite3": "VARCHAR(150)"}}, {Name: "postal_code", Type: field.TypeString, Nullable: true, Size: 10, SchemaType: map[string]string{"postgres": "VARCHAR(10)", "sqlite3": "VARCHAR(10)"}}, {Name: "business_unit_id", Type: field.TypeUUID}, {Name: "organization_id", Type: field.TypeUUID}, {Name: "state_id", Type: field.TypeUUID, Nullable: true}, {Name: "fleet_code_id", Type: field.TypeUUID, Nullable: true}, {Name: "manager_id", Type: field.TypeUUID, Nullable: true}, } // WorkersTable holds the schema information for the "workers" table. WorkersTable = &schema.Table{ Name: "workers", Columns: WorkersColumns, PrimaryKey: []*schema.Column{WorkersColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "workers_business_units_business_unit", Columns: []*schema.Column{WorkersColumns[14]}, RefColumns: []*schema.Column{BusinessUnitsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "workers_organizations_organization", Columns: []*schema.Column{WorkersColumns[15]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "workers_us_states_state", Columns: []*schema.Column{WorkersColumns[16]}, RefColumns: []*schema.Column{UsStatesColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "workers_fleet_codes_fleet_code", Columns: []*schema.Column{WorkersColumns[17]}, RefColumns: []*schema.Column{FleetCodesColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "workers_users_manager", Columns: []*schema.Column{WorkersColumns[18]}, RefColumns: []*schema.Column{UsersColumns[0]}, OnDelete: schema.Cascade, }, }, Indexes: []*schema.Index{ { Name: "worker_code_organization_id", Unique: true, Columns: []*schema.Column{WorkersColumns[5], WorkersColumns[15]}, }, { Name: "worker_first_name_last_name", Unique: false, Columns: []*schema.Column{WorkersColumns[8], WorkersColumns[9]}, }, }, } // WorkerCommentsColumns holds the columns for the "worker_comments" table. WorkerCommentsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "version", Type: field.TypeInt, Default: 1}, {Name: "comment", Type: field.TypeString, Size: 2147483647}, {Name: "worker_id", Type: field.TypeUUID}, {Name: "business_unit_id", Type: field.TypeUUID}, {Name: "organization_id", Type: field.TypeUUID}, {Name: "comment_type_id", Type: field.TypeUUID}, {Name: "user_id", Type: field.TypeUUID}, } // WorkerCommentsTable holds the schema information for the "worker_comments" table. WorkerCommentsTable = &schema.Table{ Name: "worker_comments", Columns: WorkerCommentsColumns, PrimaryKey: []*schema.Column{WorkerCommentsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "worker_comments_workers_worker_comments", Columns: []*schema.Column{WorkerCommentsColumns[5]}, RefColumns: []*schema.Column{WorkersColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "worker_comments_business_units_business_unit", Columns: []*schema.Column{WorkerCommentsColumns[6]}, RefColumns: []*schema.Column{BusinessUnitsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "worker_comments_organizations_organization", Columns: []*schema.Column{WorkerCommentsColumns[7]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "worker_comments_comment_types_comment_type", Columns: []*schema.Column{WorkerCommentsColumns[8]}, RefColumns: []*schema.Column{CommentTypesColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "worker_comments_users_user", Columns: []*schema.Column{WorkerCommentsColumns[9]}, RefColumns: []*schema.Column{UsersColumns[0]}, OnDelete: schema.NoAction, }, }, } // WorkerContactsColumns holds the columns for the "worker_contacts" table. WorkerContactsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "version", Type: field.TypeInt, Default: 1}, {Name: "name", Type: field.TypeString}, {Name: "email", Type: field.TypeString}, {Name: "phone", Type: field.TypeString}, {Name: "relationship", Type: field.TypeString, Nullable: true}, {Name: "is_primary", Type: field.TypeBool, Default: false}, {Name: "worker_id", Type: field.TypeUUID}, {Name: "business_unit_id", Type: field.TypeUUID}, {Name: "organization_id", Type: field.TypeUUID}, } // WorkerContactsTable holds the schema information for the "worker_contacts" table. WorkerContactsTable = &schema.Table{ Name: "worker_contacts", Columns: WorkerContactsColumns, PrimaryKey: []*schema.Column{WorkerContactsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "worker_contacts_workers_worker_contacts", Columns: []*schema.Column{WorkerContactsColumns[9]}, RefColumns: []*schema.Column{WorkersColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "worker_contacts_business_units_business_unit", Columns: []*schema.Column{WorkerContactsColumns[10]}, RefColumns: []*schema.Column{BusinessUnitsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "worker_contacts_organizations_organization", Columns: []*schema.Column{WorkerContactsColumns[11]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.Cascade, }, }, } // WorkerProfilesColumns holds the columns for the "worker_profiles" table. WorkerProfilesColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "version", Type: field.TypeInt, Default: 1}, {Name: "race", Type: field.TypeString, Nullable: true}, {Name: "sex", Type: field.TypeString, Nullable: true}, {Name: "date_of_birth", Type: field.TypeOther, Nullable: true, SchemaType: map[string]string{"postgres": "date", "sqlite3": "date"}}, {Name: "license_number", Type: field.TypeString}, {Name: "license_expiration_date", Type: field.TypeOther, Nullable: true, SchemaType: map[string]string{"postgres": "date", "sqlite3": "date"}}, {Name: "endorsements", Type: field.TypeEnum, Nullable: true, Enums: []string{"None", "Tanker", "Hazmat", "TankerHazmat"}, Default: "None"}, {Name: "hazmat_expiration_date", Type: field.TypeOther, Nullable: true, SchemaType: map[string]string{"postgres": "date", "sqlite3": "date"}}, {Name: "hire_date", Type: field.TypeOther, Nullable: true, SchemaType: map[string]string{"postgres": "date", "sqlite3": "date"}}, {Name: "termination_date", Type: field.TypeOther, Nullable: true, SchemaType: map[string]string{"postgres": "date", "sqlite3": "date"}}, {Name: "physical_due_date", Type: field.TypeOther, Nullable: true, SchemaType: map[string]string{"postgres": "date", "sqlite3": "date"}}, {Name: "medical_cert_date", Type: field.TypeOther, Nullable: true, SchemaType: map[string]string{"postgres": "date", "sqlite3": "date"}}, {Name: "mvr_due_date", Type: field.TypeOther, Nullable: true, SchemaType: map[string]string{"postgres": "date", "sqlite3": "date"}}, {Name: "worker_id", Type: field.TypeUUID, Unique: true}, {Name: "business_unit_id", Type: field.TypeUUID}, {Name: "organization_id", Type: field.TypeUUID}, {Name: "license_state_id", Type: field.TypeUUID}, } // WorkerProfilesTable holds the schema information for the "worker_profiles" table. WorkerProfilesTable = &schema.Table{ Name: "worker_profiles", Columns: WorkerProfilesColumns, PrimaryKey: []*schema.Column{WorkerProfilesColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "worker_profiles_workers_worker_profile", Columns: []*schema.Column{WorkerProfilesColumns[16]}, RefColumns: []*schema.Column{WorkersColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "worker_profiles_business_units_business_unit", Columns: []*schema.Column{WorkerProfilesColumns[17]}, RefColumns: []*schema.Column{BusinessUnitsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "worker_profiles_organizations_organization", Columns: []*schema.Column{WorkerProfilesColumns[18]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "worker_profiles_us_states_state", Columns: []*schema.Column{WorkerProfilesColumns[19]}, RefColumns: []*schema.Column{UsStatesColumns[0]}, OnDelete: schema.Cascade, }, }, } // GeneralLedgerAccountTagsColumns holds the columns for the "general_ledger_account_tags" table. GeneralLedgerAccountTagsColumns = []*schema.Column{ {Name: "general_ledger_account_id", Type: field.TypeUUID}, {Name: "tag_id", Type: field.TypeUUID}, } // GeneralLedgerAccountTagsTable holds the schema information for the "general_ledger_account_tags" table. GeneralLedgerAccountTagsTable = &schema.Table{ Name: "general_ledger_account_tags", Columns: GeneralLedgerAccountTagsColumns, PrimaryKey: []*schema.Column{GeneralLedgerAccountTagsColumns[0], GeneralLedgerAccountTagsColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "general_ledger_account_tags_general_ledger_account_id", Columns: []*schema.Column{GeneralLedgerAccountTagsColumns[0]}, RefColumns: []*schema.Column{GeneralLedgerAccountsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "general_ledger_account_tags_tag_id", Columns: []*schema.Column{GeneralLedgerAccountTagsColumns[1]}, RefColumns: []*schema.Column{TagsColumns[0]}, OnDelete: schema.Cascade, }, }, } // Tables holds all the tables in the schema. Tables = []*schema.Table{ AccessorialChargesTable, AccountingControlsTable, BillingControlsTable, BusinessUnitsTable, ChargeTypesTable, CommentTypesTable, CommoditiesTable, CustomersTable, DelayCodesTable, DispatchControlsTable, DivisionCodesTable, DocumentClassificationsTable, EmailControlsTable, EmailProfilesTable, EquipmentManufactuersTable, EquipmentTypesTable, FeasibilityToolControlsTable, FeatureFlagsTable, FleetCodesTable, GeneralLedgerAccountsTable, GoogleApisTable, HazardousMaterialsTable, HazardousMaterialSegregationsTable, InvoiceControlsTable, LocationsTable, LocationCategoriesTable, LocationCommentsTable, LocationContactsTable, OrganizationsTable, OrganizationFeatureFlagsTable, QualifierCodesTable, ReasonCodesTable, RevenueCodesTable, RouteControlsTable, ServiceTypesTable, SessionsTable, ShipmentControlsTable, ShipmentTypesTable, TableChangeAlertsTable, TagsTable, TractorsTable, TrailersTable, UsStatesTable, UsersTable, UserFavoritesTable, WorkersTable, WorkerCommentsTable, WorkerContactsTable, WorkerProfilesTable, GeneralLedgerAccountTagsTable, } )
Functions ¶
Types ¶
type Schema ¶
type Schema struct {
// contains filtered or unexported fields
}
Schema is the API for creating, migrating and dropping a schema.
Click to show internal directories.
Click to hide internal directories.