hasTable('currency'); if (!$exists) { $table = $this->table('currency', ['comment' => '货币配置']); $table->addColumn('name', 'string', ['limit' => 120, 'null' => false, 'default' => '', 'comment' => '货币名称']) ->addColumn('identifying', 'string', ['limit' => 80, 'null' => false, 'default' => '', 'comment' => '货币标识']) ->addColumn('ratio', 'decimal', ['precision' => 14, 'scale' => 4, 'signed' => true, 'null' => false, 'default' => 0, 'comment' => '1货币 = 点数']) ->addColumn('status', 'integer', ['limit' => MysqlAdapter::INT_TINY, 'null' => false, 'default' => 1, 'comment' => '狀態,0=停用, 1=啟用']) ->addColumn('admin_id', 'integer', ['limit' => MysqlAdapter::INT_REGULAR, 'null' => false, 'default' => 0, 'comment' => '管理员id']) ->addColumn('created_at', 'datetime', ['comment' => '创建时间']) ->addColumn('updated_at', 'datetime', ['comment' => '更新时间']) ->addColumn('deleted_at', 'datetime', ['comment' => '删除时间']) ->addIndex(['identifying'], ['name' => 'uni_identifying', 'unique' => true]) ->create(); } } }