summaryrefslogtreecommitdiff
path: root/topics/systems/mariadb/move-to-innodb.gmi
diff options
context:
space:
mode:
authorPjotr Prins2021-12-30 13:45:22 +0100
committerPjotr Prins2021-12-30 13:45:22 +0100
commitae5b18336133997c1930281edc1a897e26c7e1a5 (patch)
tree9b20415f0043b3475143a0bcc9a7cdfc66240217 /topics/systems/mariadb/move-to-innodb.gmi
parent995507d63185c93e20e7c5ff905914535eb11e33 (diff)
downloadgn-gemtext-ae5b18336133997c1930281edc1a897e26c7e1a5.tar.gz
innodb
Diffstat (limited to 'topics/systems/mariadb/move-to-innodb.gmi')
-rw-r--r--topics/systems/mariadb/move-to-innodb.gmi22
1 files changed, 22 insertions, 0 deletions
diff --git a/topics/systems/mariadb/move-to-innodb.gmi b/topics/systems/mariadb/move-to-innodb.gmi
index f5011cb..82540d4 100644
--- a/topics/systems/mariadb/move-to-innodb.gmi
+++ b/topics/systems/mariadb/move-to-innodb.gmi
@@ -340,6 +340,7 @@ It took your browser 2.119 second(s) to render this page
and it shows practically the same results.
+
## Table template
Prototocol from
@@ -353,6 +354,27 @@ Every table update has to follow the template:
* [ ] ascertain there is a backup
* [ ] copy original files
+### Make temporary table
+
+If you have enough space, you can create a copy of the actual table and do the work on that:
+
+```
+CREATE TABLE new_tbl [AS] SELECT * FROM MYTABLE;
+```
+
+Then you can change the column as desired:
+
+```
+ALTER TABLE tbl_name MODIFY COLUMN col_name BIGINT AUTO_INCREMENT;
+```
+
+Once the process is done, you can rename the tables:
+
+```
+DROP MYTABLE;
+RENAME TABLE tbl_name TO new_tbl_name, tbl_name2 TO MYTABLE;
+```
+
### Check table structure
```