drizzle-orm: [BUG]: how to recover from snapshot.json data is malformed
What version of drizzle-orm are you using?
latest
What version of drizzle-kit are you using?
latest
Describe the Bug
When trying drizzle-kit generate:sqlite --config drizzle.config.ts I get
drizzle-kit: v0.20.4
drizzle-orm: v0.29.0
Reading config file '/Users/nikos/WebstormProjects/coffeeconnect/drizzle.config.ts'
drizzle/meta/0000_snapshot.json data is malformed
the json doesnt have any syntax errors
Expected behavior
migration created
Environment & setup
MAC OS 14.0 (23A339) node v20.9.0
the JSON:
{
"version": "5",
"dialect": "sqlite",
"id": "2420c080-21b9-47c6-9e05-77c947766f87",
"prevId": "00000000-0000-0000-0000-000000000000",
"tables": {
"audit_log": {
"name": "audit_log",
"columns": {
"id": {
"name": "id",
"type": "integer",
"primaryKey": true,
"notNull": true,
"autoincrement": true
},
"action": {
"name": "action",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"table": {
"name": "table",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"record_id": {
"name": "record_id",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"data": {
"name": "data",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"user_id": {
"name": "user_id",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"created_at": {
"name": "created_at",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "CURRENT_TIMESTAMP"
}
},
"indexes": {},
"foreignKeys": {
"audit_log_user_id_user_id_fk": {
"name": "audit_log_user_id_user_id_fk",
"tableFrom": "audit_log",
"tableTo": "user",
"columnsFrom": [
"user_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
},
"booking": {
"name": "booking",
"columns": {
"id": {
"name": "id",
"type": "integer",
"primaryKey": true,
"notNull": true,
"autoincrement": true
},
"user_id": {
"name": "user_id",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"coupon_id": {
"name": "coupon_id",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"discount_percentage": {
"name": "discount_percentage",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"discount_value": {
"name": "discount_value",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"coupon_snapshot": {
"name": "coupon_snapshot",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"created_at": {
"name": "created_at",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "CURRENT_TIMESTAMP"
},
"updated_at": {
"name": "updated_at",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "CURRENT_TIMESTAMP"
}
},
"indexes": {},
"foreignKeys": {
"booking_user_id_user_id_fk": {
"name": "booking_user_id_user_id_fk",
"tableFrom": "booking",
"tableTo": "user",
"columnsFrom": [
"user_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"booking_coupon_id_coupon_id_fk": {
"name": "booking_coupon_id_coupon_id_fk",
"tableFrom": "booking",
"tableTo": "coupon",
"columnsFrom": [
"coupon_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
},
"booking_option": {
"name": "booking_option",
"columns": {
"booking_id": {
"name": "booking_id",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"option_id": {
"name": "option_id",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"quantity": {
"name": "quantity",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": 1
},
"unit_price": {
"name": "unit_price",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"option_snapshot": {
"name": "option_snapshot",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {
"booking_option_booking_id_booking_id_fk": {
"name": "booking_option_booking_id_booking_id_fk",
"tableFrom": "booking_option",
"tableTo": "booking",
"columnsFrom": [
"booking_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"booking_option_option_id_option_id_fk": {
"name": "booking_option_option_id_option_id_fk",
"tableFrom": "booking_option",
"tableTo": "option",
"columnsFrom": [
"option_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {
"booking_option_booking_id_option_id_pk": {
"columns": [
"booking_id",
"option_id"
]
}
},
"uniqueConstraints": {}
},
"booking_slot": {
"name": "booking_slot",
"columns": {
"booking_id": {
"name": "booking_id",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"slot_id": {
"name": "slot_id",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"start_time": {
"name": "start_time",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"length": {
"name": "length",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"block_price": {
"name": "block_price",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"block_quantity": {
"name": "block_quantity",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"slot_snapshot": {
"name": "slot_snapshot",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {
"booking_slot_booking_id_booking_id_fk": {
"name": "booking_slot_booking_id_booking_id_fk",
"tableFrom": "booking_slot",
"tableTo": "booking",
"columnsFrom": [
"booking_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"booking_slot_slot_id_slot_id_fk": {
"name": "booking_slot_slot_id_slot_id_fk",
"tableFrom": "booking_slot",
"tableTo": "slot",
"columnsFrom": [
"slot_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {
"booking_slot_booking_id_slot_id_pk": {
"columns": [
"booking_id",
"slot_id"
]
}
},
"uniqueConstraints": {}
},
"coupon": {
"name": "coupon",
"columns": {
"id": {
"name": "id",
"type": "integer",
"primaryKey": true,
"notNull": true,
"autoincrement": true
},
"code": {
"name": "code",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"discount_percentage": {
"name": "discount_percentage",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"discount_value": {
"name": "discount_value",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"quantity": {
"name": "quantity",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"valid_from": {
"name": "valid_from",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"valid_to": {
"name": "valid_to",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"expires_at": {
"name": "expires_at",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"organisation_id": {
"name": "organisation_id",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"space_id": {
"name": "space_id",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"slot_id": {
"name": "slot_id",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"created_at": {
"name": "created_at",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "CURRENT_TIMESTAMP"
},
"updated_at": {
"name": "updated_at",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "CURRENT_TIMESTAMP"
},
"deleted_at": {
"name": "deleted_at",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false
}
},
"indexes": {
"coupon_code_organisation_id_deleted_at_unique": {
"name": "coupon_code_organisation_id_deleted_at_unique",
"columns": [
"code",
"organisation_id",
"deleted_at"
],
"isUnique": true
}
},
"foreignKeys": {
"coupon_organisation_id_organisation_id_fk": {
"name": "coupon_organisation_id_organisation_id_fk",
"tableFrom": "coupon",
"tableTo": "organisation",
"columnsFrom": [
"organisation_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"coupon_space_id_space_id_fk": {
"name": "coupon_space_id_space_id_fk",
"tableFrom": "coupon",
"tableTo": "space",
"columnsFrom": [
"space_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"coupon_slot_id_slot_id_fk": {
"name": "coupon_slot_id_slot_id_fk",
"tableFrom": "coupon",
"tableTo": "slot",
"columnsFrom": [
"slot_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
},
"option": {
"name": "option",
"columns": {
"id": {
"name": "id",
"type": "integer",
"primaryKey": true,
"notNull": true,
"autoincrement": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"unit_price": {
"name": "unit_price",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"max_units": {
"name": "max_units",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": 1
},
"organisation_id": {
"name": "organisation_id",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"space_id": {
"name": "space_id",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"slote_id": {
"name": "slote_id",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"created_at": {
"name": "created_at",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "CURRENT_TIMESTAMP"
},
"updated_at": {
"name": "updated_at",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "CURRENT_TIMESTAMP"
},
"deleted_at": {
"name": "deleted_at",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {
"option_organisation_id_organisation_id_fk": {
"name": "option_organisation_id_organisation_id_fk",
"tableFrom": "option",
"tableTo": "organisation",
"columnsFrom": [
"organisation_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"option_space_id_space_id_fk": {
"name": "option_space_id_space_id_fk",
"tableFrom": "option",
"tableTo": "space",
"columnsFrom": [
"space_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"option_slote_id_slot_id_fk": {
"name": "option_slote_id_slot_id_fk",
"tableFrom": "option",
"tableTo": "slot",
"columnsFrom": [
"slote_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
},
"organisation": {
"name": "organisation",
"columns": {
"id": {
"name": "id",
"type": "integer",
"primaryKey": true,
"notNull": true,
"autoincrement": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"lat": {
"name": "lat",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"long": {
"name": "long",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"created_at": {
"name": "created_at",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "CURRENT_TIMESTAMP"
},
"updated_at": {
"name": "updated_at",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "CURRENT_TIMESTAMP"
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
},
"organisation_user": {
"name": "organisation_user",
"columns": {
"id": {
"name": "id",
"type": "integer",
"primaryKey": true,
"notNull": true,
"autoincrement": true
},
"organisation_id": {
"name": "organisation_id",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"user_id": {
"name": "user_id",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"role": {
"name": "role",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"created_at": {
"name": "created_at",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "CURRENT_TIMESTAMP"
},
"updated_at": {
"name": "updated_at",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "CURRENT_TIMESTAMP"
}
},
"indexes": {},
"foreignKeys": {
"organisation_user_organisation_id_organisation_id_fk": {
"name": "organisation_user_organisation_id_organisation_id_fk",
"tableFrom": "organisation_user",
"tableTo": "organisation",
"columnsFrom": [
"organisation_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"organisation_user_user_id_user_id_fk": {
"name": "organisation_user_user_id_user_id_fk",
"tableFrom": "organisation_user",
"tableTo": "user",
"columnsFrom": [
"user_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
},
"slot": {
"name": "slot",
"columns": {
"id": {
"name": "id",
"type": "integer",
"primaryKey": true,
"notNull": true,
"autoincrement": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"start_time": {
"name": "start_time",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"space_id": {
"name": "space_id",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"block_length": {
"name": "block_length",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": 30
},
"block_price": {
"name": "block_price",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": 0
},
"created_at": {
"name": "created_at",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "CURRENT_TIMESTAMP"
},
"updated_at": {
"name": "updated_at",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "CURRENT_TIMESTAMP"
},
"deleted_at": {
"name": "deleted_at",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {
"slot_space_id_space_id_fk": {
"name": "slot_space_id_space_id_fk",
"tableFrom": "slot",
"tableTo": "space",
"columnsFrom": [
"space_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
},
"slot_day_of_month": {
"name": "slot_day_of_month",
"columns": {
"slot_id": {
"name": "slot_id",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"day_of_month": {
"name": "day_of_month",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {
"slot_day_of_month_slot_id_day_of_month_pk": {
"columns": [
"day_of_month",
"slot_id"
]
}
},
"uniqueConstraints": {}
},
"slot_weekday": {
"name": "slot_weekday",
"columns": {
"slot_id": {
"name": "slot_id",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"weekday_id": {
"name": "weekday_id",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {
"slot_weekday_slot_id_weekday_id_pk": {
"columns": [
"slot_id",
"weekday_id"
]
}
},
"uniqueConstraints": {}
},
"space": {
"name": "space",
"columns": {
"id": {
"name": "id",
"type": "integer",
"primaryKey": true,
"notNull": true,
"autoincrement": true
},
"organisation_id": {
"name": "organisation_id",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"seats": {
"name": "seats",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"lat": {
"name": "lat",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"long": {
"name": "long",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"created_at": {
"name": "created_at",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "CURRENT_TIMESTAMP"
},
"updated_at": {
"name": "updated_at",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "CURRENT_TIMESTAMP"
},
"deleted_at": {
"name": "deleted_at",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {
"space_organisation_id_organisation_id_fk": {
"name": "space_organisation_id_organisation_id_fk",
"tableFrom": "space",
"tableTo": "organisation",
"columnsFrom": [
"organisation_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
},
"space_image": {
"name": "space_image",
"columns": {
"id": {
"name": "id",
"type": "integer",
"primaryKey": true,
"notNull": true,
"autoincrement": true
},
"space_id": {
"name": "space_id",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"key": {
"name": "key",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"created_at": {
"name": "created_at",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "CURRENT_TIMESTAMP"
},
"updated_at": {
"name": "updated_at",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "CURRENT_TIMESTAMP"
}
},
"indexes": {
"space_image_key_unique": {
"name": "space_image_key_unique",
"columns": [
"key"
],
"isUnique": true
}
},
"foreignKeys": {
"space_image_space_id_space_id_fk": {
"name": "space_image_space_id_space_id_fk",
"tableFrom": "space_image",
"tableTo": "space",
"columnsFrom": [
"space_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
},
"unavailable": {
"name": "unavailable",
"columns": {
"id": {
"name": "id",
"type": "integer",
"primaryKey": true,
"notNull": true,
"autoincrement": true
},
"reason": {
"name": "reason",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"organisation_id": {
"name": "organisation_id",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"space_id": {
"name": "space_id",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"start_time": {
"name": "start_time",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"end_time": {
"name": "end_time",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"created_at": {
"name": "created_at",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "CURRENT_TIMESTAMP"
},
"updated_at": {
"name": "updated_at",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "CURRENT_TIMESTAMP"
}
},
"indexes": {},
"foreignKeys": {
"unavailable_organisation_id_organisation_id_fk": {
"name": "unavailable_organisation_id_organisation_id_fk",
"tableFrom": "unavailable",
"tableTo": "organisation",
"columnsFrom": [
"organisation_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"unavailable_space_id_space_id_fk": {
"name": "unavailable_space_id_space_id_fk",
"tableFrom": "unavailable",
"tableTo": "space",
"columnsFrom": [
"space_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
},
"user": {
"name": "user",
"columns": {
"id": {
"name": "id",
"type": "integer",
"primaryKey": true,
"notNull": true,
"autoincrement": true
},
"email": {
"name": "email",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"phone": {
"name": "phone",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"password_hash": {
"name": "password_hash",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"email_verified": {
"name": "email_verified",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": false
},
"created_at": {
"name": "created_at",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "CURRENT_TIMESTAMP"
},
"updated_at": {
"name": "updated_at",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "CURRENT_TIMESTAMP"
}
},
"indexes": {
"user_email_unique": {
"name": "user_email_unique",
"columns": [
"email"
],
"isUnique": true
}
},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
},
"weekday": {
"name": "weekday",
"columns": {
"id": {
"name": "id",
"type": "integer",
"primaryKey": true,
"notNull": true,
"autoincrement": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
}
},
"enums": {},
"_meta": {
"schemas": {},
"tables": {},
"columns": {}
}
}
About this issue
- Original URL
- State: closed
- Created 7 months ago
- Reactions: 5
- Comments: 35 (13 by maintainers)
I agree it is not a great experience to manually modify generated files, but this resolved the issue for me, thx!
drizzle-kit@betafixed the issues for us as well!This is a bug, I’ll fix it! Thanks for pointing that out
Worked like a charm! Thanks for your help. I made a small donation to buy you a beer for the effort 😃 keep up the good work.
@AndriiSherman Resolved! Thank you so much 😃
just reproduced. going to fix
Had the behavior described here. Then upgraded to your recommended version @AndriiSherman
Now getting:
The index name of group is unique though. To be sure, i even renamed it to “qweasdqweqw”:
The error still stays the same.
Was released in
drizzle-kit@0.20.11. Should fix this issue. If someone will see the same - please reopen this one and ping me@jam-fran please try
drizzle-orm@betaAfter updating to
drizzle-kit@0.29.10I’m also receiving this error, but I’ve confirmed that all of my compositePrimaryKeys have names. I have over 150snapshot.jsonfiles, and all of them are malformed.Downgrading to version
0.29.9and running the same generate command results in an error:A careful inspection of my latest
snapshot.jsonconfirms this is an incorrect error as far as I can tell.Downgrading again to version
0.29.8resolves all issues and successfully performs the generation and migration commands.Below is an example of the simplest
snapshot.jsonfile that is malformed when using version0.29.10. @AndriiSherman any troubleshooting tips would be greatly appreciated!Ideally you shouldn’t change snapshot and it always should be handled by drizzle-kit