]> git.andy128k.dev Git - ipf.git/commitdiff
simplify column definition
authorAndrey Kutejko <andy128k@gmail.com>
Sat, 27 Jul 2013 17:58:29 +0000 (20:58 +0300)
committerAndrey Kutejko <andy128k@gmail.com>
Sat, 27 Jul 2013 17:58:29 +0000 (20:58 +0300)
ipf/admin/models/_generated/BaseAdminLog.php
ipf/auth/models/_generated/BasePermission.php
ipf/auth/models/_generated/BaseRole.php
ipf/auth/models/_generated/BaseRolePermission.php
ipf/auth/models/_generated/BaseUser.php
ipf/auth/models/_generated/BaseUserPermission.php
ipf/auth/models/_generated/BaseUserRole.php
ipf/orm/import/builder.php
ipf/session/models/_generated/BaseSession.php

index 264672ffe3d7ebcc64e8b2bb1c8c2b0448ed3a3d..b10e831717e6ece404e3b8d07d6718edee7da079 100644 (file)
@@ -12,13 +12,13 @@ abstract class BaseAdminLog extends IPF_ORM_Record
   {
     $table = $this->getTable();
     $table->setTableName('admin_log');
-    $this->getTable()->setColumn('username', 'string', 32, array('type' => 'string', 'length' => '32'));
-    $this->getTable()->setColumn('user_id', 'integer', null, array('type' => 'integer'));
-    $this->getTable()->setColumn('object_id', 'integer', null, array('type' => 'integer'));
-    $this->getTable()->setColumn('object_class', 'string', 200, array('type' => 'string', 'length' => '200'));
-    $this->getTable()->setColumn('object_repr', 'string', 200, array('type' => 'string', 'length' => '200'));
-    $this->getTable()->setColumn('action_flag', 'integer', null, array('type' => 'integer'));
-    $this->getTable()->setColumn('change_message', 'string', 200, array('type' => 'string', 'length' => '200'));
+    $table->setColumn('username', 'string', 32, array('type' => 'string', 'length' => '32'));
+    $table->setColumn('user_id', 'integer', null, array('type' => 'integer'));
+    $table->setColumn('object_id', 'integer', null, array('type' => 'integer'));
+    $table->setColumn('object_class', 'string', 200, array('type' => 'string', 'length' => '200'));
+    $table->setColumn('object_repr', 'string', 200, array('type' => 'string', 'length' => '200'));
+    $table->setColumn('action_flag', 'integer', null, array('type' => 'integer'));
+    $table->setColumn('change_message', 'string', 200, array('type' => 'string', 'length' => '200'));
     $table->addIndex('idx_object_id', array('fields' => 'object_id'));
     $table->addIndex('idx_object_class', array('fields' => 'object_class'));
     $table->addIndex('idx_created_at', array('fields' => 'created_at'));
index 832cdbf8b37ec78195699d80be2d3cd2d3d1f8f2..50f123117418ab1513b3b5fd553bfde9cd1afce5 100644 (file)
@@ -12,7 +12,7 @@ abstract class BasePermission extends IPF_ORM_Record
   {
     $table = $this->getTable();
     $table->setTableName('auth_permission');
-    $this->getTable()->setColumn('name', 'string', 255, array('unique' => true, 'type' => 'string', 'length' => '255'));
+    $table->setColumn('name', 'string', 255, array('unique' => true, 'type' => 'string', 'length' => '255'));
     $table->setOption('type', 'INNODB');
     $table->setOption('collate', 'utf8_unicode_ci');
     $table->setOption('charset', 'utf8');
index 79bc9fbbabfe33d861b971dfd8e82f097f0f6f69..f6009809abd6853727baa3fb1bb4bcd74c8dd845 100644 (file)
@@ -12,7 +12,7 @@ abstract class BaseRole extends IPF_ORM_Record
   {
     $table = $this->getTable();
     $table->setTableName('auth_role');
-    $this->getTable()->setColumn('name', 'string', 255, array('unique' => true, 'type' => 'string', 'notblank' => true, 'length' => '255'));
+    $table->setColumn('name', 'string', 255, array('unique' => true, 'type' => 'string', 'notblank' => true, 'length' => '255'));
     $table->setOption('type', 'INNODB');
     $table->setOption('collate', 'utf8_unicode_ci');
     $table->setOption('charset', 'utf8');
index 67b6eb7b78b0486eb3ae51111a59c546dd0d453f..85bc27484ee33897b4a8b9fcd5c2f0ad9536d2bb 100644 (file)
@@ -12,8 +12,8 @@ abstract class BaseRolePermission extends IPF_ORM_Record
   {
     $table = $this->getTable();
     $table->setTableName('auth_role_permission');
-    $this->getTable()->setColumn('role_id', 'integer', null, array('type' => 'integer', 'primary' => true));
-    $this->getTable()->setColumn('permission_id', 'integer', null, array('type' => 'integer', 'primary' => true));
+    $table->setColumn('role_id', 'integer', null, array('type' => 'integer', 'primary' => true));
+    $table->setColumn('permission_id', 'integer', null, array('type' => 'integer', 'primary' => true));
     $table->setOption('type', 'INNODB');
     $table->setOption('collate', 'utf8_unicode_ci');
     $table->setOption('charset', 'utf8');
index c11f08cd3bd77bdfa9f89fe1162dc234ffda73fb..58fefedcddf277731bfae79bdaa5c2c871f38a29 100644 (file)
@@ -12,15 +12,15 @@ abstract class BaseUser extends IPF_ORM_Record
   {
     $table = $this->getTable();
     $table->setTableName('auth_user');
-    $this->getTable()->setColumn('username', 'string', 32, array('type' => 'string', 'notblank' => true, 'notnull' => true, 'unique' => true, 'length' => '32'));
-    $this->getTable()->setColumn('password', 'string', 128, array('type' => 'string', 'notblank' => true, 'notnull' => true, 'length' => '128'));
-    $this->getTable()->setColumn('first_name', 'string', 32, array('type' => 'string', 'length' => '32'));
-    $this->getTable()->setColumn('last_name', 'string', 32, array('type' => 'string', 'length' => '32'));
-    $this->getTable()->setColumn('email', 'string', 200, array('type' => 'string', 'email' => true, 'notnull' => true, 'notblank' => true, 'unique' => true, 'length' => '200'));
-    $this->getTable()->setColumn('is_staff', 'boolean', null, array('type' => 'boolean', 'notnull' => true, 'default' => false));
-    $this->getTable()->setColumn('is_active', 'boolean', null, array('type' => 'boolean', 'notnull' => true, 'default' => false));
-    $this->getTable()->setColumn('is_superuser', 'boolean', null, array('type' => 'boolean', 'notnull' => true, 'default' => false));
-    $this->getTable()->setColumn('last_login', 'timestamp', null, array('type' => 'timestamp'));
+    $table->setColumn('username', 'string', 32, array('type' => 'string', 'notblank' => true, 'notnull' => true, 'unique' => true, 'length' => '32'));
+    $table->setColumn('password', 'string', 128, array('type' => 'string', 'notblank' => true, 'notnull' => true, 'length' => '128'));
+    $table->setColumn('first_name', 'string', 32, array('type' => 'string', 'length' => '32'));
+    $table->setColumn('last_name', 'string', 32, array('type' => 'string', 'length' => '32'));
+    $table->setColumn('email', 'string', 200, array('type' => 'string', 'email' => true, 'notnull' => true, 'notblank' => true, 'unique' => true, 'length' => '200'));
+    $table->setColumn('is_staff', 'boolean', null, array('type' => 'boolean', 'notnull' => true, 'default' => false));
+    $table->setColumn('is_active', 'boolean', null, array('type' => 'boolean', 'notnull' => true, 'default' => false));
+    $table->setColumn('is_superuser', 'boolean', null, array('type' => 'boolean', 'notnull' => true, 'default' => false));
+    $table->setColumn('last_login', 'timestamp', null, array('type' => 'timestamp'));
     $table->setOption('type', 'INNODB');
     $table->setOption('collate', 'utf8_unicode_ci');
     $table->setOption('charset', 'utf8');
index 827c84a682c0c616e5709afd053e01cd83d7777d..eee40b09752d50a9876f30a17bc34e18a4166725 100644 (file)
@@ -12,8 +12,8 @@ abstract class BaseUserPermission extends IPF_ORM_Record
   {
     $table = $this->getTable();
     $table->setTableName('auth_user_permission');
-    $this->getTable()->setColumn('user_id', 'integer', null, array('type' => 'integer', 'primary' => true));
-    $this->getTable()->setColumn('permission_id', 'integer', null, array('type' => 'integer', 'primary' => true));
+    $table->setColumn('user_id', 'integer', null, array('type' => 'integer', 'primary' => true));
+    $table->setColumn('permission_id', 'integer', null, array('type' => 'integer', 'primary' => true));
     $table->setOption('type', 'INNODB');
     $table->setOption('collate', 'utf8_unicode_ci');
     $table->setOption('charset', 'utf8');
index 5905cbb2711e5f92bacb595ecbaac0e8976bafbf..7b5c82a8c5428cd2d677069c7d1587960bff5ef4 100644 (file)
@@ -12,8 +12,8 @@ abstract class BaseUserRole extends IPF_ORM_Record
   {
     $table = $this->getTable();
     $table->setTableName('auth_user_role');
-    $this->getTable()->setColumn('user_id', 'integer', null, array('type' => 'integer', 'primary' => true));
-    $this->getTable()->setColumn('role_id', 'integer', null, array('type' => 'integer', 'primary' => true));
+    $table->setColumn('user_id', 'integer', null, array('type' => 'integer', 'primary' => true));
+    $table->setColumn('role_id', 'integer', null, array('type' => 'integer', 'primary' => true));
     $table->setOption('type', 'INNODB');
     $table->setOption('collate', 'utf8_unicode_ci');
     $table->setOption('charset', 'utf8');
index 3be0494ff0b428faf4c44f9a87257ea934379d35..cf027a2d16e5ac6cb29bb36df22c9a8e13f7bd67 100644 (file)
@@ -164,7 +164,7 @@ class IPF_ORM_Import_Builder
         $result = array();
         foreach ($columns as $name => $column) {
             $columnName = isset($column['name']) ? $column['name']:$name;
-            $build = "    ".'$this->getTable()->setColumn(\'' . $columnName . '\', \'' . $column['type'] . '\'';
+            $build = "    ".'$table->setColumn(\'' . $columnName . '\', \'' . $column['type'] . '\'';
 
             if ($column['length']) {
                 if (is_numeric($column['length']))
index 9498fa0963bf427687288de0901fea1d792ff060..a03b6fe635ce9d7f1eb9a1a233bc2d60d611ee23 100644 (file)
@@ -12,9 +12,9 @@ abstract class BaseSession extends IPF_ORM_Record
   {
     $table = $this->getTable();
     $table->setTableName('session');
-    $this->getTable()->setColumn('session_key', 'string', 40, array('primary' => true, 'type' => 'string', 'length' => '40'));
-    $this->getTable()->setColumn('session_data', 'string', null, array('type' => 'string'));
-    $this->getTable()->setColumn('expire_data', 'timestamp', null, array('type' => 'timestamp'));
+    $table->setColumn('session_key', 'string', 40, array('primary' => true, 'type' => 'string', 'length' => '40'));
+    $table->setColumn('session_data', 'string', null, array('type' => 'string'));
+    $table->setColumn('expire_data', 'timestamp', null, array('type' => 'timestamp'));
   }