summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2015-09-20 15:46:09 +0200
committerFlorian Pritz <bluewind@xinu.at>2015-09-20 15:46:09 +0200
commit2e627d7a88aed82363a7ad48dab21b2b55797452 (patch)
tree1f842ca5711765a9dd8f1c2eefc0a3994493f44f
parentffacb290fa8a30e6f3e507bf6842b281efbcd558 (diff)
postgres: Add missing prefix to index creation
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rw-r--r--application/migrations/001_add_files.php4
-rw-r--r--application/migrations/002_add_users.php4
-rw-r--r--application/migrations/003_add_referrers.php4
-rw-r--r--application/migrations/006_add_username_index.php4
-rw-r--r--application/migrations/007_repurpose_invitations.php2
-rw-r--r--application/migrations/009_add_apikeys.php2
-rw-r--r--application/migrations/012_add_constraints.php2
7 files changed, 11 insertions, 11 deletions
diff --git a/application/migrations/001_add_files.php b/application/migrations/001_add_files.php
index dd37d08c3..7b1398e1c 100644
--- a/application/migrations/001_add_files.php
+++ b/application/migrations/001_add_files.php
@@ -18,8 +18,8 @@ class Migration_Add_files extends CI_Migration {
"mimetype" varchar(255) NOT NULL,
PRIMARY KEY ("id")
);
- CREATE INDEX "files_date_idx" ON '.$prefix.'files ("date");
- CREATE INDEX "files_hash_id_idx" ON '.$prefix.'files ("hash", "id");
+ CREATE INDEX "'.$prefix.'files_date_idx" ON '.$prefix.'files ("date");
+ CREATE INDEX "'.$prefix.'files_hash_id_idx" ON '.$prefix.'files ("hash", "id");
');
} else {
$this->db->query('
diff --git a/application/migrations/002_add_users.php b/application/migrations/002_add_users.php
index 5ccef6669..454618e48 100644
--- a/application/migrations/002_add_users.php
+++ b/application/migrations/002_add_users.php
@@ -26,12 +26,12 @@ class Migration_Add_users extends CI_Migration {
"user_data" text NOT NULL,
PRIMARY KEY ("session_id")
);
- CREATE INDEX "ci_sessions_last_activity_idx" ON "'.$prefix.'ci_sessions" ("last_activity");
+ CREATE INDEX "'.$prefix.'ci_sessions_last_activity_idx" ON "'.$prefix.'ci_sessions" ("last_activity");
');
$this->db->query('
ALTER TABLE "'.$prefix.'files" ADD "user" integer NOT NULL DEFAULT 0;
- CREATE INDEX "user_idx" ON "'.$prefix.'files" ("user");
+ CREATE INDEX "'.$prefix.'user_idx" ON "'.$prefix.'files" ("user");
');
} else {
diff --git a/application/migrations/003_add_referrers.php b/application/migrations/003_add_referrers.php
index c504b5539..e6da1c0dd 100644
--- a/application/migrations/003_add_referrers.php
+++ b/application/migrations/003_add_referrers.php
@@ -15,8 +15,8 @@ class Migration_Add_referrers extends CI_Migration {
"date" integer NOT NULL,
PRIMARY KEY ("key")
);
- CREATE INDEX "invitations_user_idx" ON "'.$prefix.'invitations" ("user");
- CREATE INDEX "invitations_date_idx" ON "'.$prefix.'invitations" ("date");
+ CREATE INDEX "'.$prefix.'invitations_user_idx" ON "'.$prefix.'invitations" ("user");
+ CREATE INDEX "'.$prefix.'invitations_date_idx" ON "'.$prefix.'invitations" ("date");
');
$this->db->query('
ALTER TABLE "'.$prefix.'users"
diff --git a/application/migrations/006_add_username_index.php b/application/migrations/006_add_username_index.php
index 0e6dc7650..1633a95a9 100644
--- a/application/migrations/006_add_username_index.php
+++ b/application/migrations/006_add_username_index.php
@@ -9,7 +9,7 @@ class Migration_Add_username_index extends CI_Migration {
if ($this->db->dbdriver == 'postgre') {
$this->db->query('
- CREATE UNIQUE INDEX "users_username_idx" ON "'.$prefix.'users" ("username")
+ CREATE UNIQUE INDEX "'.$prefix.'users_username_idx" ON "'.$prefix.'users" ("username")
');
} else {
$this->db->query('
@@ -24,7 +24,7 @@ class Migration_Add_username_index extends CI_Migration {
$prefix = $this->db->dbprefix;
if ($this->db->dbdriver == 'postgre') {
- $this->db->query('DROP INDEX "users_username_idx"');
+ $this->db->query('DROP INDEX "'.$prefix.'users_username_idx"');
} else {
$this->db->query("
ALTER TABLE `'.$prefix.'users`
diff --git a/application/migrations/007_repurpose_invitations.php b/application/migrations/007_repurpose_invitations.php
index ecdef305d..0bc39c64b 100644
--- a/application/migrations/007_repurpose_invitations.php
+++ b/application/migrations/007_repurpose_invitations.php
@@ -12,7 +12,7 @@ class Migration_Repurpose_invitations extends CI_Migration {
ALTER TABLE "'.$prefix.'invitations"
ADD "action" character varying(255) NOT NULL,
ADD "data" TEXT NULL;
- CREATE INDEX "invitations_action_idx" ON '.$prefix.'invitations ("action");
+ CREATE INDEX "'.$prefix.'invitations_action_idx" ON '.$prefix.'invitations ("action");
');
$this->db->query('
diff --git a/application/migrations/009_add_apikeys.php b/application/migrations/009_add_apikeys.php
index a5af809fc..e9dba4e41 100644
--- a/application/migrations/009_add_apikeys.php
+++ b/application/migrations/009_add_apikeys.php
@@ -16,7 +16,7 @@ class Migration_Add_apikeys extends CI_Migration {
"comment" varchar(255) NOT NULL,
PRIMARY KEY ("key")
);
- CREATE INDEX "apikeys_user_idx" ON "'.$prefix.'apikeys" ("user");
+ CREATE INDEX "'.$prefix.'apikeys_user_idx" ON "'.$prefix.'apikeys" ("user");
');
} else {
diff --git a/application/migrations/012_add_constraints.php b/application/migrations/012_add_constraints.php
index 40a4540f6..a2569d54d 100644
--- a/application/migrations/012_add_constraints.php
+++ b/application/migrations/012_add_constraints.php
@@ -10,7 +10,7 @@ class Migration_add_constraints extends CI_Migration {
if ($this->db->dbdriver == 'postgre') {
$this->db->query('ALTER TABLE "'.$prefix.'users" ALTER COLUMN "referrer" TYPE integer');
$this->db->query('ALTER TABLE "'.$prefix.'users" ALTER COLUMN "referrer" DROP NOT NULL');
- $this->db->query('CREATE INDEX "users_referrer_idx" ON "'.$prefix.'users" ("referrer")');
+ $this->db->query('CREATE INDEX "'.$prefix.'users_referrer_idx" ON "'.$prefix.'users" ("referrer")');
$this->db->query('UPDATE "'.$prefix.'users" SET "referrer" = NULL where "referrer" = 0');
$this->db->query('
ALTER TABLE "'.$prefix.'users"