hasTable('richdocuments_template')) { $table = $schema->createTable('richdocuments_template'); $table->addColumn('id', 'bigint', [ 'autoincrement' => true, 'notnull' => true, 'length' => 20, 'unsigned' => true, ]); $table->addColumn('userid', 'string', [ 'notnull' => false, 'length' => 64, ]); $table->addColumn('fileid', 'bigint', [ 'notnull' => true, 'length' => 20, ]); $table->addColumn('templateid', 'bigint', [ 'notnull' => true, 'length' => 20, ]); $table->addColumn('timestamp', 'bigint', [ 'notnull' => true, 'length' => 20, 'unsigned' => true, ]); $table->setPrimaryKey(['id']); $table->addUniqueIndex(['userid', 'fileid'], 'rd_t_user_file'); } return $schema; } }