Comments (9)
Ok thanks, that's quite a job. For anyone that want's a nice quick and easy way to do that, adjust this to your needs and run
#!/bin/bash
# Get a list of all databases
databases=$(mysql -u your_username -p'your_password' -e 'SHOW DATABASES;' | grep -Ev 'Database|information_schema|performance_schema|mysql')
# Loop through each database
for db in $databases; do
# Get a list of all tables in the current database
tables=$(mysql -u your_username -p'your_password' $db -e 'SHOW TABLES;' | grep -v 'Tables_in_')
# Loop through each table
for table in $tables; do
# Execute the ALTER TABLE command, quoting table names with backticks
mysql -u your_username -p'your_password' $db -e "ALTER TABLE \`$table\` ROW_FORMAT=DYNAMIC;"
done
done
from postal.
It seems the initial error was different:
== 20240214132253 AddLockFieldsToWebhookRequests: migrating ===================
-- add_column(:webhook_requests, :locked_by, :string)
-> 0.0105s
-- add_column(:webhook_requests, :locked_at, :datetime, {:precision=>nil})
-> 0.0147s
-- add_index(:webhook_requests, :locked_by)
rake aborted!
StandardError: An error has occurred, all later migrations canceled: (StandardError)
Mysql2::Error: Index column size too large. The maximum column size is 767 bytes
/usr/local/bundle/gems/mysql2-0.5.6/lib/mysql2/client.rb:151:in `_query'
/usr/local/bundle/gems/mysql2-0.5.6/lib/mysql2/client.rb:151:in `block in query'
/usr/local/bundle/gems/mysql2-0.5.6/lib/mysql2/client.rb:150:in `handle_interrupt'
/usr/local/bundle/gems/mysql2-0.5.6/lib/mysql2/client.rb:150:in `query'
/usr/local/bundle/gems/activerecord-7.0.8.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:638:in `block (2 levels) in raw_execute'
/usr/local/bundle/gems/activesupport-7.0.8.1/lib/active_support/concurrency/share_lock.rb:187:in `yield_shares'
from postal.
What version of MySQL/MariaDB are you using?
from postal.
MariaDB 10.6.16 - that seems to be the issue. Upgrading right now.
from postal.
Upgraded to 11.2.1:
== 20240223141500 AddTwoFactorRequiredToSessions: migrating ===================
Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
from postal.
ALTER TABLE authie_sessions ROW_FORMAT=DYNAMIC;
Fixed the problem
from postal.
Glad you got this sorted.
I have added a note to the upgrade page to note that people do need to be aware of the row format on their tables before upgrading.
https://docs.postalserver.io/getting-started/upgrade-to-v3#database-considerations
from postal.
The docs state "It is important that any pre-existing tables in your database are set up with the DYNAMIC row format." .. does this include all of the postal-server-X databases as well, or just the main postal db?
from postal.
I'd recommend making sure all tables in all databases are set like that to avoid any potential issue in the future.
from postal.
Related Issues (20)
- Support for authentication on SMTP relays HOT 4
- Problem on upgrading postal to 2.3.0 HOT 5
- Characters being stripped from emails since upgrade from 2.1.2 to 2.3.0 HOT 21
- Privacy mode not work in v2.3.1, but works in v2.3.0 HOT 1
- Getting Internal error: Encoding::CompatibilityError: incompatible character encodings: UTF-8 and ASCII-8BIT HOT 4
- Mysql2::Error: Data too long for column 'output' at row 1 HOT 1
- Sometimes postal sent email to A record insted of MX HOT 1
- Set `Content-Id` header on attachments through send message API HOT 1
- Cannot send emails after upgrading to v3 HOT 2
- Unable to receive incoming email after upgrade to V3 HOT 8
- Documentation is missing how to upgrade docker containers from version 2.x.x to V3 HOT 2
- Postal with IPv6 breaks r
- Postal with IPv6 breaks Rspamd HOT 1
- Migrating existing config to `version: 2` can cause issues HOT 9
- Postal v3 fails to forward messages to SMTP servers
- Postal Don't Override Environment Variables HOT 1
- Unable to get incoming mails - Broken pipe smtp-server HOT 1
- Webhook error / Mysql2::Error (Data too long for column 'body' at row 1) HOT 1
- v3 Breaking Changes: log files HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from postal.