diff options
author | Jeremy Benoist <jeremy.benoist@gmail.com> | 2018-06-14 14:15:07 +0200 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2018-06-14 14:15:07 +0200 |
commit | 49b4c875985c7b001af711079662dd3684373229 (patch) | |
tree | acc9f383852c9bf33396672135275e0747dd722d /app | |
parent | bfe7a692261760517199a3797191fd214fc2ee6c (diff) | |
download | wallabag-49b4c875985c7b001af711079662dd3684373229.tar.gz wallabag-49b4c875985c7b001af711079662dd3684373229.tar.zst wallabag-49b4c875985c7b001af711079662dd3684373229.zip |
We should able to get the table name unescaped
When we want to perform complex queries to retrieve metadata from the database
Diffstat (limited to 'app')
-rw-r--r-- | app/DoctrineMigrations/Version20161001072726.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/app/DoctrineMigrations/Version20161001072726.php b/app/DoctrineMigrations/Version20161001072726.php index bb7e6968..4e19a54a 100644 --- a/app/DoctrineMigrations/Version20161001072726.php +++ b/app/DoctrineMigrations/Version20161001072726.php | |||
@@ -24,7 +24,7 @@ class Version20161001072726 extends WallabagMigration | |||
24 | $query = $this->connection->query(" | 24 | $query = $this->connection->query(" |
25 | SELECT CONSTRAINT_NAME | 25 | SELECT CONSTRAINT_NAME |
26 | FROM information_schema.key_column_usage | 26 | FROM information_schema.key_column_usage |
27 | WHERE TABLE_NAME = '" . $this->getTable('entry_tag') . "' AND CONSTRAINT_NAME LIKE 'FK_%' | 27 | WHERE TABLE_NAME = '" . $this->getTable('entry_tag', WallabagMigration::UN_ESCAPED_TABLE) . "' AND CONSTRAINT_NAME LIKE 'FK_%' |
28 | AND TABLE_SCHEMA = '" . $this->connection->getDatabase() . "'" | 28 | AND TABLE_SCHEMA = '" . $this->connection->getDatabase() . "'" |
29 | ); | 29 | ); |
30 | $query->execute(); | 30 | $query->execute(); |
@@ -42,7 +42,7 @@ class Version20161001072726 extends WallabagMigration | |||
42 | FROM pg_constraint c | 42 | FROM pg_constraint c |
43 | JOIN pg_namespace n ON n.oid = c.connamespace | 43 | JOIN pg_namespace n ON n.oid = c.connamespace |
44 | WHERE contype = 'f' | 44 | WHERE contype = 'f' |
45 | AND conrelid::regclass::text = '" . $this->getTable('entry_tag') . "' | 45 | AND conrelid::regclass::text = '" . $this->getTable('entry_tag', WallabagMigration::UN_ESCAPED_TABLE) . "' |
46 | AND n.nspname = 'public';" | 46 | AND n.nspname = 'public';" |
47 | ); | 47 | ); |
48 | $query->execute(); | 48 | $query->execute(); |
@@ -63,7 +63,7 @@ class Version20161001072726 extends WallabagMigration | |||
63 | $query = $this->connection->query(" | 63 | $query = $this->connection->query(" |
64 | SELECT CONSTRAINT_NAME | 64 | SELECT CONSTRAINT_NAME |
65 | FROM information_schema.key_column_usage | 65 | FROM information_schema.key_column_usage |
66 | WHERE TABLE_NAME = '" . $this->getTable('annotation') . "' | 66 | WHERE TABLE_NAME = '" . $this->getTable('annotation', WallabagMigration::UN_ESCAPED_TABLE) . "' |
67 | AND CONSTRAINT_NAME LIKE 'FK_%' | 67 | AND CONSTRAINT_NAME LIKE 'FK_%' |
68 | AND COLUMN_NAME = 'entry_id' | 68 | AND COLUMN_NAME = 'entry_id' |
69 | AND TABLE_SCHEMA = '" . $this->connection->getDatabase() . "'" | 69 | AND TABLE_SCHEMA = '" . $this->connection->getDatabase() . "'" |
@@ -83,7 +83,7 @@ class Version20161001072726 extends WallabagMigration | |||
83 | FROM pg_constraint c | 83 | FROM pg_constraint c |
84 | JOIN pg_namespace n ON n.oid = c.connamespace | 84 | JOIN pg_namespace n ON n.oid = c.connamespace |
85 | WHERE contype = 'f' | 85 | WHERE contype = 'f' |
86 | AND conrelid::regclass::text = '" . $this->getTable('annotation') . "' | 86 | AND conrelid::regclass::text = '" . $this->getTable('annotation', WallabagMigration::UN_ESCAPED_TABLE) . "' |
87 | AND n.nspname = 'public' | 87 | AND n.nspname = 'public' |
88 | AND pg_get_constraintdef(c.oid) LIKE '%entry_id%';" | 88 | AND pg_get_constraintdef(c.oid) LIKE '%entry_id%';" |
89 | ); | 89 | ); |