12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- <?php
- use yii\db\Migration;
- /**
- * Class m240809_172822_obra
- */
- class m240809_172822_obra extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- $this->createTable('Obra', [
- "id" => $this->string(36),
- "nombre" => $this->string(100)->notNull(),
- "fechaInicio" => $this->timestamp()->append(" with time zone"),
- "fechaFinal" => $this->timestamp()->append(" with time zone"),
- "descripcion" => $this->string(100)->notNull(),
- "creado" => $this->timestamp()->append(" with time zone"),
- "modificado" => $this->timestamp()->append(" with time zone"),
- "eliminado" => $this->timestamp()->append(" with time zone"),
- ]);
- $this->addPrimaryKey('ObraPK', 'Obra', 'id');
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- $this->dropTable('Obra');
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "m240809_172822_obra cannot be reverted.\n";
- return false;
- }
- */
- }
|