2019-09-18 17:32:12 +00:00
|
|
|
import { schemaMigrations, addColumns } from '@nozbe/watermelondb/Schema/migrations';
|
|
|
|
|
|
|
|
export default schemaMigrations({
|
|
|
|
migrations: [
|
|
|
|
{
|
|
|
|
toVersion: 2,
|
|
|
|
steps: [
|
|
|
|
addColumns({
|
|
|
|
table: 'subscriptions',
|
|
|
|
columns: [
|
|
|
|
{ name: 'jitsi_timeout', type: 'number', isOptional: true }
|
|
|
|
]
|
|
|
|
})
|
|
|
|
]
|
2019-10-28 20:04:44 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
toVersion: 3,
|
|
|
|
steps: [
|
|
|
|
addColumns({
|
|
|
|
table: 'subscriptions',
|
|
|
|
columns: [
|
|
|
|
{ name: 'hide_unread_status', type: 'boolean', isOptional: true }
|
|
|
|
]
|
|
|
|
})
|
|
|
|
]
|
2020-02-11 14:01:35 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
toVersion: 4,
|
|
|
|
steps: [
|
|
|
|
addColumns({
|
|
|
|
table: 'messages',
|
|
|
|
columns: [
|
|
|
|
{ name: 'blocks', type: 'string', isOptional: true }
|
|
|
|
]
|
|
|
|
}),
|
|
|
|
addColumns({
|
|
|
|
table: 'slash_commands',
|
|
|
|
columns: [
|
|
|
|
{ name: 'app_id', type: 'string', isOptional: true }
|
|
|
|
]
|
|
|
|
})
|
|
|
|
]
|
2020-02-20 20:43:56 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
toVersion: 5,
|
|
|
|
steps: [
|
|
|
|
addColumns({
|
|
|
|
table: 'settings',
|
|
|
|
columns: [
|
|
|
|
{ name: 'value_as_array', type: 'string', isOptional: true }
|
|
|
|
]
|
|
|
|
})
|
|
|
|
]
|
2020-03-06 14:19:03 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
toVersion: 6,
|
|
|
|
steps: [
|
|
|
|
addColumns({
|
|
|
|
table: 'subscriptions',
|
|
|
|
columns: [
|
|
|
|
{ name: 'sys_mes', type: 'string', isOptional: true }
|
|
|
|
]
|
|
|
|
})
|
|
|
|
]
|
2020-04-01 12:28:54 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
toVersion: 7,
|
|
|
|
steps: [
|
|
|
|
addColumns({
|
|
|
|
table: 'subscriptions',
|
|
|
|
columns: [
|
|
|
|
{ name: 'uids', type: 'string', isOptional: true },
|
|
|
|
{ name: 'usernames', type: 'string', isOptional: true }
|
|
|
|
]
|
|
|
|
})
|
|
|
|
]
|
2020-05-08 12:57:04 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
toVersion: 8,
|
|
|
|
steps: [
|
2020-05-08 17:16:22 +00:00
|
|
|
addColumns({
|
|
|
|
table: 'messages',
|
|
|
|
columns: [
|
|
|
|
{ name: 'emoji', type: 'string', isOptional: true }
|
|
|
|
]
|
|
|
|
}),
|
|
|
|
addColumns({
|
|
|
|
table: 'thread_messages',
|
|
|
|
columns: [
|
|
|
|
{ name: 'emoji', type: 'string', isOptional: true }
|
|
|
|
]
|
|
|
|
}),
|
|
|
|
addColumns({
|
|
|
|
table: 'threads',
|
|
|
|
columns: [
|
|
|
|
{ name: 'emoji', type: 'string', isOptional: true }
|
|
|
|
]
|
|
|
|
}),
|
2020-05-08 12:57:04 +00:00
|
|
|
addColumns({
|
|
|
|
table: 'subscriptions',
|
|
|
|
columns: [
|
2020-05-08 17:36:10 +00:00
|
|
|
{ name: 'banner_closed', type: 'boolean', isOptional: true },
|
|
|
|
{ name: 'visitor', type: 'string', isOptional: true },
|
|
|
|
{ name: 'department_id', type: 'string', isOptional: true },
|
|
|
|
{ name: 'served_by', type: 'string', isOptional: true },
|
|
|
|
{ name: 'livechat_data', type: 'string', isOptional: true },
|
|
|
|
{ name: 'tags', type: 'string', isOptional: true }
|
|
|
|
]
|
|
|
|
}),
|
|
|
|
addColumns({
|
|
|
|
table: 'rooms',
|
|
|
|
columns: [
|
|
|
|
{ name: 'v', type: 'string', isOptional: true },
|
|
|
|
{ name: 'department_id', type: 'string', isOptional: true },
|
|
|
|
{ name: 'served_by', type: 'string', isOptional: true },
|
|
|
|
{ name: 'livechat_data', type: 'string', isOptional: true },
|
|
|
|
{ name: 'tags', type: 'string', isOptional: true }
|
2020-05-08 12:57:04 +00:00
|
|
|
]
|
|
|
|
})
|
|
|
|
]
|
2020-07-29 20:49:08 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
toVersion: 9,
|
|
|
|
steps: [
|
|
|
|
addColumns({
|
|
|
|
table: 'subscriptions',
|
|
|
|
columns: [
|
|
|
|
{ name: 'group_mentions', type: 'number', isOptional: true }
|
|
|
|
]
|
|
|
|
})
|
|
|
|
]
|
2020-09-11 14:31:38 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
toVersion: 10,
|
|
|
|
steps: [
|
|
|
|
addColumns({
|
|
|
|
table: 'subscriptions',
|
|
|
|
columns: [
|
|
|
|
{ name: 'e2e_key', type: 'string', isOptional: true },
|
|
|
|
{ name: 'encrypted', type: 'boolean', isOptional: true },
|
|
|
|
{ name: 'e2e_key_id', type: 'string', isOptional: true }
|
|
|
|
]
|
|
|
|
}),
|
|
|
|
addColumns({
|
|
|
|
table: 'messages',
|
|
|
|
columns: [
|
|
|
|
{ name: 'e2e', type: 'string', isOptional: true }
|
|
|
|
]
|
|
|
|
}),
|
|
|
|
addColumns({
|
|
|
|
table: 'thread_messages',
|
|
|
|
columns: [
|
|
|
|
{ name: 'e2e', type: 'string', isOptional: true }
|
|
|
|
]
|
|
|
|
}),
|
|
|
|
addColumns({
|
|
|
|
table: 'threads',
|
|
|
|
columns: [
|
|
|
|
{ name: 'e2e', type: 'string', isOptional: true }
|
|
|
|
]
|
|
|
|
}),
|
|
|
|
addColumns({
|
|
|
|
table: 'rooms',
|
|
|
|
columns: [
|
|
|
|
{ name: 'e2e_key_id', type: 'string', isOptional: true }
|
|
|
|
]
|
|
|
|
})
|
|
|
|
]
|
2019-09-18 17:32:12 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
});
|