Class lispa\amos\core\migration\AmosMigrationTableCreation

Inheritancelispa\amos\core\migration\AmosMigrationTableCreation » yii\db\Migration » yii\base\Component » yii\base\Object
Implementsyii\base\Configurable, yii\db\MigrationInterface
Uses Traitsyii\db\SchemaBuilderTrait

Class AmosMigrationTableCreation. This class is useful to create new table. The basic use provides the override of these methods: protected function setTableName() and protected function setTableFields().

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$behaviors yii\base\Behavior[] List of behaviors attached to this component yii\base\Component
$db yii\db\Connection|array|string The DB connection object or the application component ID of the DB connection that this migration should work with. yii\db\Migration
$extraTableOptions string lispa\amos\core\migration\AmosMigrationTableCreation
$processInverted boolean lispa\amos\core\migration\AmosMigrationTableCreation
$rawTableName string lispa\amos\core\migration\AmosMigrationTableCreation

Public Methods

Hide inherited methods

MethodDescriptionDefined By
__call() Calls the named method which is not a class method. yii\base\Component
__clone() This method is called after the object is created by cloning an existing one. yii\base\Component
__construct() Constructor. yii\base\Object
__get() Returns the value of a component property. yii\base\Component
__isset() Checks if a property is set, i.e. defined and not null. yii\base\Component
__set() Sets the value of a component property. yii\base\Component
__unset() Sets a component property to be null. yii\base\Component
addColumn() Builds and executes a SQL statement for adding a new DB column. yii\db\Migration
addCommentOnColumn() Builds and execute a SQL statement for adding comment to column yii\db\Migration
addCommentOnTable() Builds a SQL statement for adding comment to table yii\db\Migration
addForeignKey() Builds a SQL statement for adding a foreign key constraint to an existing table. yii\db\Migration
addPrimaryKey() Builds and executes a SQL statement for creating a primary key. yii\db\Migration
alterColumn() Builds and executes a SQL statement for changing the definition of a column. yii\db\Migration
attachBehavior() Attaches a behavior to this component. yii\base\Component
attachBehaviors() Attaches a list of behaviors to the component. yii\base\Component
batchInsert() Creates and executes an batch INSERT SQL statement. yii\db\Migration
behaviors() Returns a list of behaviors that this component should behave as. yii\base\Component
bigInteger() Creates a bigint column. yii\db\SchemaBuilderTrait
bigPrimaryKey() Creates a big primary key column. yii\db\SchemaBuilderTrait
binary() Creates a binary column. yii\db\SchemaBuilderTrait
boolean() Creates a boolean column. yii\db\SchemaBuilderTrait
canGetProperty() Returns a value indicating whether a property can be read. yii\base\Component
canSetProperty() Returns a value indicating whether a property can be set. yii\base\Component
char() Creates a char column. yii\db\SchemaBuilderTrait
className() Returns the fully qualified name of this class. yii\base\Object
createIndex() Builds and executes a SQL statement for creating a new index. yii\db\Migration
createTable() Builds and executes a SQL statement for creating a new DB table. yii\db\Migration
date() Creates a date column. yii\db\SchemaBuilderTrait
dateTime() Creates a datetime column. yii\db\SchemaBuilderTrait
decimal() Creates a decimal column. yii\db\SchemaBuilderTrait
delete() Creates and executes a DELETE SQL statement. yii\db\Migration
detachBehavior() Detaches a behavior from the component. yii\base\Component
detachBehaviors() Detaches all behaviors from the component. yii\base\Component
double() Creates a double column. yii\db\SchemaBuilderTrait
down() This method contains the logic to be executed when removing this migration. yii\db\Migration
dropColumn() Builds and executes a SQL statement for dropping a DB column. yii\db\Migration
dropCommentFromColumn() Builds and execute a SQL statement for dropping comment from column yii\db\Migration
dropCommentFromTable() Builds a SQL statement for dropping comment from table yii\db\Migration
dropForeignKey() Builds a SQL statement for dropping a foreign key constraint. yii\db\Migration
dropIndex() Builds and executes a SQL statement for dropping an index. yii\db\Migration
dropPrimaryKey() Builds and executes a SQL statement for dropping a primary key. yii\db\Migration
dropTable() Builds and executes a SQL statement for dropping a DB table. yii\db\Migration
ensureBehaviors() Makes sure that the behaviors declared in behaviors() are attached to this component. yii\base\Component
execute() Executes a SQL statement. yii\db\Migration
float() Creates a float column. yii\db\SchemaBuilderTrait
getBehavior() Returns the named behavior object. yii\base\Component
getBehaviors() Returns all behaviors attached to this component. yii\base\Component
getExtraTableOptions() lispa\amos\core\migration\AmosMigrationTableCreation
getRawTableName() It returns the raw table name. lispa\amos\core\migration\AmosMigrationTableCreation
hasEventHandlers() Returns a value indicating whether there is any handler attached to the named event. yii\base\Component
hasMethod() Returns a value indicating whether a method is defined. yii\base\Component
hasProperty() Returns a value indicating whether a property is defined for this component. yii\base\Component
init() lispa\amos\core\migration\AmosMigrationTableCreation
insert() Creates and executes an INSERT SQL statement. yii\db\Migration
integer() Creates an integer column. yii\db\SchemaBuilderTrait
isProcessInverted() lispa\amos\core\migration\AmosMigrationTableCreation
isToAddCreatedUpdatedFields() lispa\amos\core\migration\AmosMigrationTableCreation
money() Creates a money column. yii\db\SchemaBuilderTrait
off() Detaches an existing event handler from this component. yii\base\Component
on() Attaches an event handler to an event. yii\base\Component
primaryKey() Creates a primary key column. yii\db\SchemaBuilderTrait
renameColumn() Builds and executes a SQL statement for renaming a column. yii\db\Migration
renameTable() Builds and executes a SQL statement for renaming a DB table. yii\db\Migration
safeDown() Use this instead of function down(). lispa\amos\core\migration\AmosMigrationTableCreation
safeUp() Use this instead of function up(). lispa\amos\core\migration\AmosMigrationTableCreation
setAddCreatedUpdatedFields() lispa\amos\core\migration\AmosMigrationTableCreation
setExtraTableOptions() lispa\amos\core\migration\AmosMigrationTableCreation
setProcessInverted() lispa\amos\core\migration\AmosMigrationTableCreation
setRawTableName() This method is useful for set the raw table name. lispa\amos\core\migration\AmosMigrationTableCreation
smallInteger() Creates a smallint column. yii\db\SchemaBuilderTrait
string() Creates a string column. yii\db\SchemaBuilderTrait
text() Creates a text column. yii\db\SchemaBuilderTrait
time() Creates a time column. yii\db\SchemaBuilderTrait
timestamp() Creates a timestamp column. yii\db\SchemaBuilderTrait
trigger() Triggers an event. yii\base\Component
truncateTable() Builds and executes a SQL statement for truncating a DB table. yii\db\Migration
up() This method contains the logic to be executed when applying this migration. yii\db\Migration
update() Creates and executes an UPDATE SQL statement. yii\db\Migration

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
addForeignKeys() Override to add foreign keys after table creation. lispa\amos\core\migration\AmosMigrationTableCreation
afterDropTable() Override to make operations after the table drop. lispa\amos\core\migration\AmosMigrationTableCreation
afterForeignKeysAdd() Override to make operations after adding foreign keys. lispa\amos\core\migration\AmosMigrationTableCreation
afterTableCreation() Override to make operations after the table creation. lispa\amos\core\migration\AmosMigrationTableCreation
beforeDropTable() Override to make operations before the table drop. lispa\amos\core\migration\AmosMigrationTableCreation
beforeForeignKeysAdd() Override to make operations before adding foreign keys. lispa\amos\core\migration\AmosMigrationTableCreation
beforeTableCreation() Override to make operations before the table creation. lispa\amos\core\migration\AmosMigrationTableCreation
getDb() yii\db\SchemaBuilderTrait
setTableFields() In this method you define all table fields. You must insert the definitions in this array: $this->tableFields = []; lispa\amos\core\migration\AmosMigrationTableCreation
setTableName() In this method you define the table name like this: $this->tableName = '{{%table_name}}'; lispa\amos\core\migration\AmosMigrationTableCreation

Property Details

$addCreatedUpdatedFields protected write-only property

If true, add the created... and updated... table fields.

public void setAddCreatedUpdatedFields ( $addCreatedUpdatedFields )
$extraTableOptions public property
public string getExtraTableOptions ( )
public void setExtraTableOptions ( $extraTableOptions )
$processInverted public write-only property
public void setProcessInverted ( $processInverted )
$rawTableName public property
public string getRawTableName ( )
public void setRawTableName ( $rawTableName )
$tableFields protected property

An array where define table fields.

protected array $tableFields null
$tableName protected property

The table name.

protected string $tableName null

Method Details

addForeignKeys() protected method

Override to add foreign keys after table creation.

protected void addForeignKeys ( )
afterDropTable() protected method

Override to make operations after the table drop.

protected void afterDropTable ( )
afterForeignKeysAdd() protected method

Override to make operations after adding foreign keys.

protected void afterForeignKeysAdd ( )
afterTableCreation() protected method

Override to make operations after the table creation.

protected void afterTableCreation ( )
beforeDropTable() protected method

Override to make operations before the table drop.

protected void beforeDropTable ( )
beforeForeignKeysAdd() protected method

Override to make operations before adding foreign keys.

protected void beforeForeignKeysAdd ( )
beforeTableCreation() protected method

Override to make operations before the table creation.

protected void beforeTableCreation ( )
getExtraTableOptions() public method

public string getExtraTableOptions ( )
getRawTableName() public method

It returns the raw table name.

public string getRawTableName ( )
init() public method

See also yii\db\Migration::init() for more info.

public void init ( )
isProcessInverted() public method

public boolean isProcessInverted ( )
isToAddCreatedUpdatedFields() public method

public boolean isToAddCreatedUpdatedFields ( )
safeDown() public method

Use this instead of function down().

See also \Yii\db\Migration::safeDown() for more info.

public void safeDown ( )
safeUp() public method

Use this instead of function up().

See also \Yii\db\Migration::safeUp() for more info.

public void safeUp ( )
setAddCreatedUpdatedFields() public method

public void setAddCreatedUpdatedFields ( $addCreatedUpdatedFields )
$addCreatedUpdatedFields boolean
setExtraTableOptions() public method

public void setExtraTableOptions ( $extraTableOptions )
$extraTableOptions string
setProcessInverted() public method

public void setProcessInverted ( $processInverted )
$processInverted boolean
setRawTableName() public method

This method is useful for set the raw table name.

public void setRawTableName ( $rawTableName )
$rawTableName string
setTableFields() protected method

In this method you define all table fields. You must insert the definitions in this array: $this->tableFields = [];

protected void setTableFields ( )
setTableName() protected method

In this method you define the table name like this: $this->tableName = '{{%table_name}}';

protected void setTableName ( )