{“timestamp”:“2023-01-26 04:41:34.802 Z”,“level”:“info”,“msg”:“Server is initializing…”,“caller”:“app/server.go:262”,“go_version”:“go1.18.1”}
{“timestamp”:“2023-01-26 04:41:34.803 Z”,“level”:“info”,“msg”:“Pinging SQL”,“caller”:“sqlstore/store.go:226”,“database”:“master”}
{“timestamp”:“2023-01-26 04:41:34.829 Z”,“level”:“info”,“msg”:“Pinging SQL”,“caller”:“sqlstore/store.go:226”,“database”:“master”}
{“timestamp”:“2023-01-26 04:41:34.866 Z”,“level”:“fatal”,“msg”:“Failed to apply database migrations.”,“caller”:“sqlstore/store.go:163”,“error”:“driver: mysql, message: failed when applying migration, command: apply_migration, originalError: Error 1304: PROCEDURE Migrate_LastRootPostAt already exists, query: \n\nCREATE PROCEDURE Migrate_LastRootPostAt ()\nBEGIN\nDECLARE\n\tLastRootPostAt_EXIST INT;\n\tSELECT\n\t\tCOUNT(*)\n\tFROM\n\t\tINFORMATION_SCHEMA.COLUMNS\n\tWHERE\n\t\tTABLE_NAME = ‘Channels’\n\t\tAND table_schema = DATABASE()\n\t\tAND COLUMN_NAME = ‘LastRootPostAt’ INTO LastRootPostAt_EXIST;\n\tIF(LastRootPostAt_EXIST = 0) THEN\n ALTER TABLE Channels ADD COLUMN LastRootPostAt bigint DEFAULT 0;\n\t\tUPDATE\n\t\t\tChannels\n\t\t\tINNER JOIN (\n\t\t\t\tSELECT\n\t\t\t\t\tChannels.Id channelid,\n\t\t\t\t\tCOALESCE(MAX(Posts.CreateAt), 0) AS lastrootpost\n\t\t\t\tFROM\n\t\t\t\t\tChannels\n\t\t\t\t\tLEFT JOIN Posts FORCE INDEX (idx_posts_channel_id_update_at) ON Channels.Id = Posts.ChannelId\n\t\t\t\tWHERE\n\t\t\t\t\tPosts.RootId = ‘’\n\t\t\t\tGROUP BY\n\t\t\t\t\tChannels.Id) AS q ON q.channelid = Channels.Id SET LastRootPostAt = lastrootpost;\n\tEND IF;\nEND;\n\tCALL Migrate_LastRootPostAt ();\n\tDROP PROCEDURE IF EXISTS Migrate_LastRootPostAt;\n\n”}