[Filebin-general] [PATCH 2/2] Use InnoDB for the files table

Pierre Schmitz pierre at archlinux.de
Sun Sep 22 09:36:59 CEST 2013


The files table was MyISAM even though all other tables were InnoDB.
We should avoid mixing types here (backups, transactions and performance).

Signed-off-by: Pierre Schmitz <pierre at archlinux.de>
---
 application/config/migration.php            |  2 +-
 application/migrations/010_files_innodb.php | 16 ++++++++++++++++
 2 files changed, 17 insertions(+), 1 deletion(-)
 create mode 100644 application/migrations/010_files_innodb.php

diff --git a/application/config/migration.php b/application/config/migration.php
index 5fef0ad..6cfd09a 100644
--- a/application/config/migration.php
+++ b/application/config/migration.php
@@ -21,7 +21,7 @@ $config['migration_enabled'] = true;
 | be upgraded / downgraded to.
 |
 */
-$config['migration_version'] = 9;
+$config['migration_version'] = 10;
 
 
 /*
diff --git a/application/migrations/010_files_innodb.php b/application/migrations/010_files_innodb.php
new file mode 100644
index 0000000..b32f947
--- /dev/null
+++ b/application/migrations/010_files_innodb.php
@@ -0,0 +1,16 @@
+<?php
+defined('BASEPATH') OR exit('No direct script access allowed');
+
+class Migration_files_innodb extends CI_Migration {
+
+	public function up()
+	{
+		$this->db->query("
+			ALTER TABLE `files` ENGINE = InnoDB;
+		");
+	}
+
+	public function down()
+	{
+	}
+}
-- 
1.8.4


More information about the Filebin-general mailing list