From 647fe3220bd1818adb0a04f16dd79e9ce622bd91 Mon Sep 17 00:00:00 2001 From: Andrey Kutejko Date: Sat, 27 Jul 2013 10:05:58 +0300 Subject: [PATCH] column collate --- ipf/orm/datadict/mysql.php | 5 ----- ipf/orm/export.php | 9 ++------- ipf/orm/export/mysql.php | 4 ++-- ipf/orm/import/schema.php | 1 + 4 files changed, 5 insertions(+), 14 deletions(-) diff --git a/ipf/orm/datadict/mysql.php b/ipf/orm/datadict/mysql.php index ddba725..cf5620b 100644 --- a/ipf/orm/datadict/mysql.php +++ b/ipf/orm/datadict/mysql.php @@ -350,11 +350,6 @@ class IPF_ORM_DataDict_Mysql extends IPF_ORM_DataDict return 'CHARACTER SET ' . $charset; } - public function getCollationFieldDeclaration($collation) - { - return 'COLLATE ' . $collation; - } - public function getIntegerDeclaration($name, $field) { $default = $autoinc = ''; diff --git a/ipf/orm/export.php b/ipf/orm/export.php index 005aab6..6cf51a4 100644 --- a/ipf/orm/export.php +++ b/ipf/orm/export.php @@ -226,8 +226,8 @@ class IPF_ORM_Export extends IPF_ORM_Connection_Module $charset = (isset($field['charset']) && $field['charset']) ? ' ' . $this->getCharsetFieldDeclaration($field['charset']) : ''; - $collation = (isset($field['collation']) && $field['collation']) ? - ' ' . $this->getCollationFieldDeclaration($field['collation']) : ''; + $collation = (isset($field['collate']) && $field['collate']) ? + ' COLLATE ' . $field['collate'] : ''; $notnull = (isset($field['notnull']) && $field['notnull']) ? ' NOT NULL' : ''; @@ -409,11 +409,6 @@ class IPF_ORM_Export extends IPF_ORM_Connection_Module return ''; } - public function getCollationFieldDeclaration($collation) - { - return ''; - } - public function exportSortedClassesSql($classes, $groupByConnection = true) { $connections = array(); diff --git a/ipf/orm/export/mysql.php b/ipf/orm/export/mysql.php index fb90b11..b2b2605 100644 --- a/ipf/orm/export/mysql.php +++ b/ipf/orm/export/mysql.php @@ -121,8 +121,8 @@ class IPF_ORM_Export_Mysql extends IPF_ORM_Export $charset = (isset($field['charset']) && $field['charset']) ? ' ' . $this->getCharsetFieldDeclaration($field['charset']) : ''; - $collation = (isset($field['collation']) && $field['collation']) ? - ' ' . $this->getCollationFieldDeclaration($field['collation']) : ''; + $collation = (isset($field['collate']) && $field['collate']) ? + ' COLLATE ' . $field['collate'] : ''; $notnull = (isset($field['notnull']) && $field['notnull']) ? ' NOT NULL' : ''; diff --git a/ipf/orm/import/schema.php b/ipf/orm/import/schema.php index 551b9fd..6a6736e 100644 --- a/ipf/orm/import/schema.php +++ b/ipf/orm/import/schema.php @@ -39,6 +39,7 @@ class IPF_ORM_Import_Schema 'zerofill', 'owner', 'exclude', + 'collate', ), 'relation' => array( 'key', -- 2.49.0