1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-28 17:02:04 +03:00

Attached images to pages and added restriction filtering

Closes #79
This commit is contained in:
Dan Brown
2016-03-13 13:30:47 +00:00
parent 75ecf1c44d
commit dbe11c1360
10 changed files with 73 additions and 45 deletions

View File

@ -3,7 +3,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class ImageEntitiesAndPageDrafts extends Migration
class AddPageDrafts extends Migration
{
/**
* Run the migrations.
@ -12,12 +12,6 @@ class ImageEntitiesAndPageDrafts extends Migration
*/
public function up()
{
Schema::table('images', function (Blueprint $table) {
$table->string('entity_type', 100);
$table->integer('entity_id');
$table->index(['entity_type', 'entity_id']);
});
Schema::table('pages', function(Blueprint $table) {
$table->boolean('draft')->default(false);
$table->index('draft');
@ -31,12 +25,6 @@ class ImageEntitiesAndPageDrafts extends Migration
*/
public function down()
{
Schema::table('images', function (Blueprint $table) {
$table->dropIndex(['entity_type', 'entity_id']);
$table->dropColumn('entity_type');
$table->dropColumn('entity_id');
});
Schema::table('pages', function (Blueprint $table) {
$table->dropColumn('draft');
});