sql/abstractSchemaChanges/patch-translate_message_group_subscriptions-composite-primary-key.json
{
"comment": "Drop auto-increment primary key and use composite primary key",
"before": {
"name": "translate_message_group_subscriptions",
"columns": [
{
"name": "tmgs_subscription_id",
"type": "integer",
"options": {
"autoincrement": true,
"unsigned": true,
"notnull": true
}
},
{
"name": "tmgs_user_id",
"type": "integer",
"options": { "unsigned": true, "notnull": true }
},
{
"name": "tmgs_group",
"type": "binary",
"options": { "notnull": true, "length": 200 }
}
],
"indexes": [
{
"name": "translate_tmgs_user_id",
"comment": "Index for finding all group subscriptions of the user",
"columns": [
"tmgs_user_id"
],
"unique": false
},
{
"name": "translate_tmgs_group",
"comment": "Index for finding all users subscribed to a group",
"columns": [
"tmgs_group"
],
"unique": false
}
],
"pk": [ "tmgs_subscription_id" ]
},
"after": {
"name": "translate_message_group_subscriptions",
"comment": "Translate message group subscriptions table",
"columns": [
{
"name": "tmgs_user_id",
"comment": "Subscribed user ID",
"type": "integer",
"options": { "unsigned": true, "notnull": true }
},
{
"name": "tmgs_group",
"comment": "Group ID that user has subscribed to",
"type": "binary",
"options": { "notnull": true, "length": 200 }
}
],
"indexes": [
{
"name": "translate_tmgs_user_id",
"comment": "Index for finding all group subscriptions of the user",
"columns": [
"tmgs_user_id"
],
"unique": false
}
],
"pk": [ "tmgs_group", "tmgs_user_id" ]
}
}