hasTable('quicknotes_attach')) { $table = $schema->createTable('quicknotes_attach'); $table->addColumn('id', 'bigint', [ 'autoincrement' => true, 'notnull' => true, 'length' => 8, 'unsigned' => true, ]); $table->addColumn('user_id', 'string', [ 'notnull' => true, 'length' => 200, 'default' => '', ]); $table->addColumn('note_id', 'bigint', [ 'notnull' => true, 'length' => 8, 'unsigned' => true, ]); $table->addColumn('file_id', 'bigint', [ 'notnull' => true, 'length' => 10, ]); $table->addColumn('created_at', 'bigint', [ 'notnull' => false, 'length' => 8, 'default' => 0, 'unsigned' => true, ]); $table->setPrimaryKey(['id']); $table->addIndex(['user_id'], 'attach_user_id_index'); $table->addIndex(['note_id'], 'attach_note_id_index'); $table->addIndex(['file_id'], 'attach_file_id_index'); } return $schema; } }