Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Change primary key field name

Mira Szewczyk73586e5ddc15
diff --git a/saleor/graphql/schema.graphql b/saleor/graphql/schema.graphql
index fac2ae67d9..b7738e44bc 100644
--- a/saleor/graphql/schema.graphql
+++ b/saleor/graphql/schema.graphql
@@ -4528,13 +4528,12 @@ type VoucherUpdate {
}
type Warehouse implements Node {
- uuid: UUID!
+ id: ID!
name: String!
companyName: String!
shippingZones(before: String, after: String, first: Int, last: Int): ShippingZoneCountableConnection!
address: Address!
email: String!
- id: ID!
}
input WarehouseAddressInput {
diff --git a/saleor/warehouse/migrations/0001_initial.py b/saleor/warehouse/migrations/0001_initial.py
index b63d8e0fa6..8d9351c231 100644
--- a/saleor/warehouse/migrations/0001_initial.py
+++ b/saleor/warehouse/migrations/0001_initial.py
@@ -1,4 +1,4 @@
-# Generated by Django 2.2.6 on 2019-11-13 13:08
+# Generated by Django 2.2.6 on 2019-11-15 14:54
import uuid
@@ -20,7 +20,7 @@ class Migration(migrations.Migration):
name="Warehouse",
fields=[
(
- "uuid",
+ "id",
models.UUIDField(
default=uuid.uuid4, primary_key=True, serialize=False
),
diff --git a/saleor/warehouse/models.py b/saleor/warehouse/models.py
index 106f5cbc62..428450f1d6 100644
--- a/saleor/warehouse/models.py
+++ b/saleor/warehouse/models.py
@@ -13,7 +13,7 @@ class WarehouseQueryset(models.QuerySet):
class Warehouse(models.Model):
- uuid = models.UUIDField(default=uuid.uuid4, primary_key=True)
+ id = models.UUIDField(default=uuid.uuid4, primary_key=True)
name = models.CharField(
pgettext_lazy("Warehouse field description", "Warehouse name"), max_length=50
)