createTable('{{%GUEST_DECLARATION_DRAFT}}', [ 'ID' => $this->string(32)->notNull(), 'ORDER_SN' => $this->string(32)->notNull(), 'ACCESS_TOKEN_HASH' => $this->string(64)->notNull(), 'STATUS' => $this->string(32)->notNull(), 'PAYLOAD' => $this->text()->notNull(), 'ORDER_SNAPSHOT' => $this->text()->notNull(), 'PAY_AMOUNT' => $this->decimal(20, 6)->notNull(), 'CURRENCY' => $this->string(8)->notNull(), 'PAYMENT_REFERENCE' => $this->string(128), 'PAYMENT_NOTE' => $this->text(), 'USER_ID' => $this->string(32), 'CREATED_AT' => $this->integer()->notNull(), 'UPDATED_AT' => $this->integer(), 'EXPIRES_AT' => $this->integer()->notNull(), 'PAID_AT' => $this->integer(), 'COMPLETED_AT' => $this->integer(), 'PRIMARY KEY ([[ID]])', ]); $this->createIndex('UX_GUEST_DRAFT_ORDER_SN', '{{%GUEST_DECLARATION_DRAFT}}', 'ORDER_SN', true); $this->createIndex('UX_GUEST_DRAFT_TOKEN_HASH', '{{%GUEST_DECLARATION_DRAFT}}', 'ACCESS_TOKEN_HASH', true); $this->createIndex('UX_GUEST_DRAFT_PAYMENT_REF', '{{%GUEST_DECLARATION_DRAFT}}', 'PAYMENT_REFERENCE', true); $this->createIndex('IX_GUEST_DRAFT_STATUS_EXPIRY', '{{%GUEST_DECLARATION_DRAFT}}', ['STATUS', 'EXPIRES_AT']); } public function safeDown() { $this->dropTable('{{%GUEST_DECLARATION_DRAFT}}'); } }