migrate Database migrations written in Go. Use as CLI or import as library. Migrate reads migrations from sources and applies them in correct order to a database. The migration tool uses a schema_migrations table. One table exists for one DB. mysql> select * from schema_migrations; +———+——-+ | version | dirty | +———+——-+ | 33 | 0 | +———+——-+ 1 row…
Tag: sql
MySQL: Convert Character Set and Collation
The character set and collation changes for a DB have important changes on the storage requirements and query result behavior. The character set for a table can be changed in two ways: a. Using CONVERT TO query b. Using MODIFY <column name> Methods The CONVERT TO method makes sure that each column fits the new character set range after conversion.…

Database Trigger Procedure in Postgres
An introduction to triggers in Postgres
PostGres: Update Column with Array Values
Update an Array UPDATE users SET topics = ‘{crows, cats}’; Append an Array UPDATE users SET topics = topics || ‘{cats,mice}’; Append operation creates duplicates. Reference https://makandracards.com/makandra/36097-postgresql-how-to-add-remove-modify-array-values-and-how-to-replace-1-value-with-multiple-values