2021-09-13 20:41:05 +00:00
|
|
|
import { addColumns, createTable, schemaMigrations } from '@nozbe/watermelondb/Schema/migrations';
|
2020-03-30 20:19:01 +00:00
|
|
|
|
|
|
|
export default schemaMigrations({
|
|
|
|
migrations: [
|
|
|
|
{
|
|
|
|
toVersion: 3,
|
|
|
|
steps: [
|
|
|
|
addColumns({
|
|
|
|
table: 'users',
|
2021-09-13 20:41:05 +00:00
|
|
|
columns: [{ name: 'statusText', type: 'string', isOptional: true }]
|
2020-03-30 20:19:01 +00:00
|
|
|
})
|
|
|
|
]
|
2020-05-08 17:04:37 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
toVersion: 4,
|
|
|
|
steps: [
|
|
|
|
addColumns({
|
|
|
|
table: 'servers',
|
|
|
|
columns: [
|
|
|
|
{ name: 'last_local_authenticated_session', type: 'number', isOptional: true },
|
|
|
|
{ name: 'auto_lock', type: 'boolean', isOptional: true },
|
|
|
|
{ name: 'auto_lock_time', type: 'number', isOptional: true },
|
|
|
|
{ name: 'biometry', type: 'boolean', isOptional: true }
|
|
|
|
]
|
|
|
|
})
|
|
|
|
]
|
2020-07-30 17:25:52 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
toVersion: 5,
|
|
|
|
steps: [
|
|
|
|
addColumns({
|
|
|
|
table: 'servers',
|
2021-09-13 20:41:05 +00:00
|
|
|
columns: [{ name: 'unique_id', type: 'string', isOptional: true }]
|
2020-07-30 17:25:52 +00:00
|
|
|
})
|
|
|
|
]
|
2020-08-21 13:38:50 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
toVersion: 6,
|
|
|
|
steps: [
|
|
|
|
addColumns({
|
|
|
|
table: 'servers',
|
2021-09-13 20:41:05 +00:00
|
|
|
columns: [{ name: 'enterprise_modules', type: 'string', isOptional: true }]
|
2020-08-21 13:38:50 +00:00
|
|
|
})
|
|
|
|
]
|
2020-08-25 20:04:18 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
toVersion: 7,
|
|
|
|
steps: [
|
|
|
|
addColumns({
|
|
|
|
table: 'users',
|
2021-09-13 20:41:05 +00:00
|
|
|
columns: [{ name: 'login_email_password', type: 'boolean', isOptional: true }]
|
2020-08-25 20:04:18 +00:00
|
|
|
})
|
|
|
|
]
|
2020-09-11 14:31:38 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
toVersion: 8,
|
|
|
|
steps: [
|
|
|
|
addColumns({
|
|
|
|
table: 'servers',
|
2021-09-13 20:41:05 +00:00
|
|
|
columns: [{ name: 'e2e_enable', type: 'boolean', isOptional: true }]
|
2020-09-11 14:31:38 +00:00
|
|
|
})
|
|
|
|
]
|
2020-09-11 17:10:16 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
toVersion: 9,
|
|
|
|
steps: [
|
|
|
|
createTable({
|
|
|
|
name: 'servers_history',
|
|
|
|
columns: [
|
|
|
|
{ name: 'url', type: 'string', isIndexed: true },
|
|
|
|
{ name: 'username', type: 'string', isOptional: true },
|
|
|
|
{ name: 'updated_at', type: 'number' }
|
|
|
|
]
|
|
|
|
})
|
|
|
|
]
|
2020-10-30 13:12:02 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
toVersion: 10,
|
|
|
|
steps: [
|
|
|
|
addColumns({
|
|
|
|
table: 'users',
|
|
|
|
columns: [
|
2020-10-30 17:35:07 +00:00
|
|
|
{ name: 'show_message_in_main_thread', type: 'boolean', isOptional: true },
|
2020-10-30 13:12:02 +00:00
|
|
|
{ name: 'avatar_etag', type: 'string', isOptional: true }
|
|
|
|
]
|
|
|
|
})
|
|
|
|
]
|
2021-09-13 20:41:05 +00:00
|
|
|
},
|
|
|
|
{
|
2021-07-05 18:21:15 +00:00
|
|
|
toVersion: 11,
|
|
|
|
steps: [
|
|
|
|
addColumns({
|
|
|
|
table: 'users',
|
2021-09-13 20:41:05 +00:00
|
|
|
columns: [{ name: 'is_from_webview', type: 'boolean', isOptional: true }]
|
2021-07-05 18:21:15 +00:00
|
|
|
})
|
|
|
|
]
|
2021-10-20 16:32:58 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
toVersion: 12,
|
|
|
|
steps: [
|
|
|
|
addColumns({
|
|
|
|
table: 'users',
|
|
|
|
columns: [{ name: 'enable_message_parser_early_adoption', type: 'boolean', isOptional: true }]
|
|
|
|
})
|
|
|
|
]
|
2023-08-01 17:34:05 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
toVersion: 13,
|
|
|
|
steps: [
|
|
|
|
addColumns({
|
|
|
|
table: 'users',
|
|
|
|
columns: [
|
|
|
|
{ name: 'nickname', type: 'string', isOptional: true },
|
|
|
|
{ name: 'bio', type: 'string', isOptional: true }
|
|
|
|
]
|
|
|
|
})
|
|
|
|
]
|
2023-10-19 13:38:57 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
toVersion: 14,
|
|
|
|
steps: [
|
|
|
|
addColumns({
|
|
|
|
table: 'servers',
|
|
|
|
columns: [
|
|
|
|
{ name: 'supported_versions', type: 'string', isOptional: true },
|
|
|
|
{
|
|
|
|
name: 'supported_versions_warning_at',
|
|
|
|
type: 'number',
|
|
|
|
isOptional: true
|
|
|
|
}
|
|
|
|
]
|
|
|
|
})
|
|
|
|
]
|
2020-03-30 20:19:01 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
});
|