mattermost-mobile/app/database/migration/server/index.ts
Elias Nahum 2f3dfbbbfa
Update dependencies and upgrade to RN 0.76.5 (#8421)
* update dev deps

* partial update dependencies

* update watermelondb

* update rn to 0.76.5, expo to 52.0.18 and others

* upgrade android firebase

* upgrade detox deps

* fix package-lock.json

* update emm and paste-input

* update turbo-log

* update network library

* fix tests

* review feedback

* fix Keyboard blocking signIn button

* Fall back to iphone 14 iOS 17.2 simulator as app crashes on iOS 17.4

* changes in deleteCredentialsForServer is causing a crash

* withOptions x2 clearly is wrong

* re-add cli-platform-apple fix

* fix: RN 0.76.5 issue with bottom sheet disappearing (#8478)

* experiment, using view vs BottomSheetView

* revert previous & try disabling enableDynamicSizing

* revert an unintended removal

---------

Co-authored-by: yasserfaraazkhan <attitude3cena.yf@gmail.com>
Co-authored-by: Mattermost Build <build@mattermost.com>
Co-authored-by: Rahim Rahman <rahim.rahman@mattermost.com>
2025-01-16 07:11:32 -07:00

83 lines
2.6 KiB
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
// NOTE : To implement migration, please follow this document
// https://nozbe.github.io/WatermelonDB/Advanced/Migrations.html
import {addColumns, createTable, schemaMigrations, unsafeExecuteSql} from '@nozbe/watermelondb/Schema/migrations';
import {MM_TABLES} from '@constants/database';
const {CHANNEL_BOOKMARK, CHANNEL_INFO, DRAFT, POST} = MM_TABLES.SERVER;
export default schemaMigrations({migrations: [
{
toVersion: 6,
steps: [
unsafeExecuteSql('CREATE INDEX IF NOT EXISTS Post_type ON Post (type);'),
],
},
{
toVersion: 5,
steps: [
addColumns({
table: DRAFT,
columns: [
{name: 'update_at', type: 'number'},
],
}),
],
},
{
toVersion: 4,
steps: [
createTable({
name: CHANNEL_BOOKMARK,
columns: [
{name: 'create_at', type: 'number'},
{name: 'update_at', type: 'number'},
{name: 'delete_at', type: 'number'},
{name: 'channel_id', type: 'string', isIndexed: true},
{name: 'owner_id', type: 'string'},
{name: 'file_id', type: 'string', isOptional: true},
{name: 'display_name', type: 'string'},
{name: 'sort_order', type: 'number'},
{name: 'link_url', type: 'string', isOptional: true},
{name: 'image_url', type: 'string', isOptional: true},
{name: 'emoji', type: 'string', isOptional: true},
{name: 'type', type: 'string'},
{name: 'original_id', type: 'string', isOptional: true},
{name: 'parent_id', type: 'string', isOptional: true},
],
}),
],
},
{
toVersion: 3,
steps: [
addColumns({
table: POST,
columns: [
{name: 'message_source', type: 'string'},
],
}),
],
},
{
toVersion: 2,
steps: [
addColumns({
table: CHANNEL_INFO,
columns: [
{name: 'files_count', type: 'number'},
],
}),
addColumns({
table: DRAFT,
columns: [
{name: 'metadata', type: 'string', isOptional: true},
],
}),
],
},
]});