summaryrefslogtreecommitdiff
path: root/topics/systems/mariadb/move-to-innodb.gmi
diff options
context:
space:
mode:
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
```