Skip to content
Snippets Groups Projects
Commit e7ca0fe5 authored by Neil Drumm's avatar Neil Drumm :wave:
Browse files

#93506 by sammys. Postgres needs a different column type for source and target.

parent 83f4d886
No related branches found
No related tags found
No related merge requests found
...@@ -5,6 +5,9 @@ ...@@ -5,6 +5,9 @@
* Implementation of hook_install(). * Implementation of hook_install().
*/ */
function locale_install() { function locale_install() {
// locales_source.source and locales_target.target are not used as binary
// fields; non-MySQL database servers need to ensure the field type is text
// and that LIKE produces a case-sensitive comparison.
switch ($GLOBALS['db_type']) { switch ($GLOBALS['db_type']) {
case 'mysql': case 'mysql':
case 'mysqli': case 'mysqli':
...@@ -38,6 +41,7 @@ function locale_install() { ...@@ -38,6 +41,7 @@ function locale_install() {
KEY plural (plural) KEY plural (plural)
) /*!40100 DEFAULT CHARACTER SET UTF8 */ "); ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
break; break;
case 'pgsql': case 'pgsql':
db_query("CREATE TABLE {locales_meta} ( db_query("CREATE TABLE {locales_meta} (
locale varchar(12) NOT NULL default '', locale varchar(12) NOT NULL default '',
...@@ -52,13 +56,13 @@ function locale_install() { ...@@ -52,13 +56,13 @@ function locale_install() {
db_query("CREATE TABLE {locales_source} ( db_query("CREATE TABLE {locales_source} (
lid serial, lid serial,
location varchar(255) NOT NULL default '', location varchar(255) NOT NULL default '',
source bytea NOT NULL, source text NOT NULL,
PRIMARY KEY (lid) PRIMARY KEY (lid)
)"); )");
db_query("CREATE TABLE {locales_target} ( db_query("CREATE TABLE {locales_target} (
lid int NOT NULL default '0', lid int NOT NULL default '0',
translation bytea NOT NULL, translation text NOT NULL,
locale varchar(12) NOT NULL default '', locale varchar(12) NOT NULL default '',
plid int NOT NULL default '0', plid int NOT NULL default '0',
plural int NOT NULL default '0' plural int NOT NULL default '0'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment