Shopware 6.7.8.1 order
Core order records — contains order state, totals, currency, billing address reference, and campaign tracking.
Columns
| Column | Type | Nullable | Additional |
|---|---|---|---|
| id | binary(16) | NO | Primary Key |
| version_id | binary(16) | NO | Primary Key |
| state_id | binary(16) | NO | Index Foreign Key → state_machine_state.id |
| auto_increment | bigint unsigned | NO | Unique, auto_increment |
| order_number | varchar(64) | YES | Index |
| currency_id | binary(16) | NO | Index Foreign Key → currency.id |
| language_id | binary(16) | NO | Index Foreign Key → language.id |
| currency_factor | double | YES | |
| sales_channel_id | binary(16) | NO | Index Foreign Key → sales_channel.id |
| billing_address_id | binary(16) | NO | |
| billing_address_version_id | binary(16) | NO | |
| price | json | NO | |
| order_date_time | datetime(3) | NO | |
| order_date | date | YES | Index, STORED GENERATED |
| amount_total | double | YES | VIRTUAL GENERATED |
| amount_net | double | YES | VIRTUAL GENERATED |
| position_price | double | YES | VIRTUAL GENERATED |
| tax_status | varchar(255) | YES | VIRTUAL GENERATED |
| shipping_costs | json | NO | |
| shipping_total | double | YES | VIRTUAL GENERATED |
| deep_link_code | varchar(32) | YES | Index |
| custom_fields | json | YES | |
| affiliate_code | varchar(255) | YES | |
| campaign_code | varchar(255) | YES | |
| customer_comment | longtext | YES | |
| created_at | datetime(3) | NO | |
| updated_at | datetime(3) | YES | |
| item_rounding | json | YES | |
| total_rounding | json | YES | |
| rule_ids | json | YES | |
| created_by_id | binary(16) | YES | Index Foreign Key → user.id |
| updated_by_id | binary(16) | YES | Index Foreign Key → user.id |
| source | varchar(255) | YES | |
| primary_order_delivery_id | binary(16) | YES | |
| primary_order_delivery_version_id | binary(16) | YES | |
| primary_order_transaction_id | binary(16) | YES | |
| primary_order_transaction_version_id | binary(16) | YES | |
| internal_comment | longtext | YES | |
| tax_calculation_type | varchar(50) | YES |
Indexes
| Index Name | Columns | Unique |
|---|---|---|
| fk.language_id | language_id | No |
| fk.order.created_by_id | created_by_id | No |
| fk.order.currency_id | currency_id | No |
| fk.order.sales_channel_id | sales_channel_id | No |
| fk.order.updated_by_id | updated_by_id | No |
| idx.order_date_currency_id | order_date,currency_id | No |
| idx.order_number | order_number | No |
| idx.state_index | state_id | No |
| PRIMARY | id,version_id | Yes |
| uidx.order.primary_order_delivery | id,version_id,primary_order_delivery_id | Yes |
| uidx.order.primary_order_transaction | id,version_id,primary_order_transaction_id | Yes |
| uniq.auto_increment | auto_increment | Yes |
| uniq.deep_link_code | deep_link_code,version_id | Yes |
Relations (from this table)
| Local Field | Foreign Table | Foreign Field |
|---|---|---|
| language_id | language | id |
| created_by_id | user | id |
| currency_id | currency | id |
| sales_channel_id | sales_channel | id |
| state_id | state_machine_state | id |
| updated_by_id | user | id |
Relations (to this table)
| Local Field | Foreign Table | Foreign Field |
|---|---|---|
| id | document | order_id |
| version_id | document | order_version_id |
| id | order_address | order_id |
| version_id | order_address | order_version_id |
| id | order_customer | order_id |
| version_id | order_customer | order_version_id |
| id | order_delivery | order_id |
| version_id | order_delivery | order_version_id |
| id | order_line_item | order_id |
| version_id | order_line_item | order_version_id |
| id | order_tag | order_id |
| version_id | order_tag | order_version_id |
| id | order_transaction | order_id |
| version_id | order_transaction | order_version_id |
