createTable( 'order', [ 'id' => $this->primaryKey(), 'user_id' => $this->integer(), 'name' => $this->string(), 'phone' => $this->string(), 'email' => $this->string(), 'city' => $this->string(), 'address' => $this->string(), 'comment' => $this->string(), 'label_id' => $this->integer() ->notNull(), 'delivery_id' => $this->integer() ->notNull(), 'payment_id' => $this->integer() ->notNull(), 'created_at' => $this->integer(), 'updated_at' => $this->integer(), 'deleted_at' => $this->integer(), ] ); $this->addForeignKey('order_user_id_fkey', 'order', 'user_id', 'customer', 'id', 'RESTRICT', 'CASCADE'); } /** * @inheritdoc */ public function down() { $this->dropForeignKey('order_user_id_fkey', 'order'); $this->dropTable('order'); } }