table('theme_file_versions'); $table->addColumn('theme_type', 'string', ['limit' => 20, 'null' => false, 'comment' => "'frontend' or 'admin'"]) ->addColumn('theme_name', 'string', ['limit' => 255, 'null' => false]) ->addColumn('file_path', 'string', ['limit' => 500, 'null' => false, 'comment' => 'path relative to the theme root']) ->addColumn('content', 'text', ['null' => false, 'comment' => 'file content as it was BEFORE the save that created this version']) ->addColumn('created_at', 'datetime', ['null' => false, 'default' => 'CURRENT_TIMESTAMP']) ->addColumn('created_by', 'integer', ['null' => true]) ->addForeignKey('created_by', 'users', 'id') ->addIndex(['theme_type', 'theme_name', 'file_path']) ->create(); } }