public function up() { $this->foreign = true; O::import('application.components.TableNames'); $tmp = explode(':', $this->getDbConnection()->connectionString, 2); $this->driver = strtolower($tmp[0]); if ($this->driver == 'mysql') { $this->execute('SET FOREIGN_KEY_CHECKS = 0'); } if ($this->driver == 'sqlite') { $this->foreign = false; } $this->dropTableIfExists('{{images}}'); $this->createTable('{{images}}', array('img_id' => 'pk', 'file_path' => 'string NOT NULL', 'file_url' => 'string NOT NULL', 'width' => 'integer NOT NULL', 'height' => 'integer NOT NULL', 'created' => 'timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP')); $this->tableUser(); $this->dataUser(); $this->tableOrg(); $this->dataOrg(); $this->tableDivision(); $this->dataDiv(); $this->tableForms(); $this->dataForm(); $this->tableWawancara(); $this->dataWawancara(); }
<?php O::import('application.models._base.BaseImages'); class Images extends BaseImages { public static function model($className = __CLASS__) { return parent::model($className); } }