diff --git a/framework/core/migrations/2015_02_24_000000_create_access_tokens_table.php b/framework/core/migrations/2015_02_24_000000_create_access_tokens_table.php index a3e6cf183..ee2a0be58 100644 --- a/framework/core/migrations/2015_02_24_000000_create_access_tokens_table.php +++ b/framework/core/migrations/2015_02_24_000000_create_access_tokens_table.php @@ -1,7 +1,7 @@ schema->create('access_tokens', function (Blueprint $table) { $table->string('id', 100)->primary(); $table->integer('user_id')->unsigned(); $table->timestamp('created_at'); @@ -28,6 +28,6 @@ class CreateAccessTokensTable extends Migration */ public function down() { - Schema::drop('access_tokens'); + $this->schema->drop('access_tokens'); } } diff --git a/framework/core/migrations/2015_02_24_000000_create_activity_table.php b/framework/core/migrations/2015_02_24_000000_create_activity_table.php index 0dbd21b1f..2f1415944 100644 --- a/framework/core/migrations/2015_02_24_000000_create_activity_table.php +++ b/framework/core/migrations/2015_02_24_000000_create_activity_table.php @@ -1,7 +1,7 @@ schema->create('activity', function (Blueprint $table) { $table->increments('id'); $table->integer('user_id')->unsigned(); $table->string('type', 100); @@ -31,6 +31,6 @@ class CreateActivityTable extends Migration */ public function down() { - Schema::drop('activity'); + $this->schema->drop('activity'); } } diff --git a/framework/core/migrations/2015_02_24_000000_create_config_table.php b/framework/core/migrations/2015_02_24_000000_create_config_table.php index 9f0f99081..784338bc6 100644 --- a/framework/core/migrations/2015_02_24_000000_create_config_table.php +++ b/framework/core/migrations/2015_02_24_000000_create_config_table.php @@ -1,7 +1,7 @@ schema->create('config', function (Blueprint $table) { $table->string('key', 100)->primary(); $table->binary('value')->nullable(); @@ -28,6 +28,6 @@ class CreateConfigTable extends Migration */ public function down() { - Schema::drop('config'); + $this->schema->drop('config'); } } diff --git a/framework/core/migrations/2015_02_24_000000_create_discussions_table.php b/framework/core/migrations/2015_02_24_000000_create_discussions_table.php index 2f8a84bb8..af8c5df81 100644 --- a/framework/core/migrations/2015_02_24_000000_create_discussions_table.php +++ b/framework/core/migrations/2015_02_24_000000_create_discussions_table.php @@ -1,7 +1,7 @@ schema->create('discussions', function (Blueprint $table) { $table->increments('id'); $table->string('title', 200); @@ -40,6 +40,6 @@ class CreateDiscussionsTable extends Migration */ public function down() { - Schema::drop('discussions'); + $this->schema->drop('discussions'); } } diff --git a/framework/core/migrations/2015_02_24_000000_create_email_tokens_table.php b/framework/core/migrations/2015_02_24_000000_create_email_tokens_table.php index 26480127a..284e50a6f 100644 --- a/framework/core/migrations/2015_02_24_000000_create_email_tokens_table.php +++ b/framework/core/migrations/2015_02_24_000000_create_email_tokens_table.php @@ -1,7 +1,7 @@ schema->create('email_tokens', function (Blueprint $table) { $table->string('id', 100)->primary(); $table->integer('user_id')->unsigned(); $table->string('email', 150); @@ -28,6 +28,6 @@ class CreateEmailTokensTable extends Migration */ public function down() { - Schema::drop('email_tokens'); + $this->schema->drop('email_tokens'); } } diff --git a/framework/core/migrations/2015_02_24_000000_create_groups_table.php b/framework/core/migrations/2015_02_24_000000_create_groups_table.php index 0eee5a50e..e5a55174e 100644 --- a/framework/core/migrations/2015_02_24_000000_create_groups_table.php +++ b/framework/core/migrations/2015_02_24_000000_create_groups_table.php @@ -1,7 +1,7 @@ schema->create('groups', function (Blueprint $table) { $table->increments('id'); $table->string('name_singular', 100); $table->string('name_plural', 100); @@ -29,6 +29,6 @@ class CreateGroupsTable extends Migration */ public function down() { - Schema::drop('groups'); + $this->schema->drop('groups'); } } diff --git a/framework/core/migrations/2015_02_24_000000_create_notifications_table.php b/framework/core/migrations/2015_02_24_000000_create_notifications_table.php index 88a684eb9..4fae9b6c5 100644 --- a/framework/core/migrations/2015_02_24_000000_create_notifications_table.php +++ b/framework/core/migrations/2015_02_24_000000_create_notifications_table.php @@ -1,7 +1,7 @@ schema->create('notifications', function (Blueprint $table) { $table->increments('id'); $table->integer('user_id')->unsigned(); @@ -36,6 +36,6 @@ class CreateNotificationsTable extends Migration */ public function down() { - Schema::drop('notifications'); + $this->schema->drop('notifications'); } } diff --git a/framework/core/migrations/2015_02_24_000000_create_password_tokens_table.php b/framework/core/migrations/2015_02_24_000000_create_password_tokens_table.php index 17be6acff..8f50aa06f 100644 --- a/framework/core/migrations/2015_02_24_000000_create_password_tokens_table.php +++ b/framework/core/migrations/2015_02_24_000000_create_password_tokens_table.php @@ -1,7 +1,7 @@ schema->create('password_tokens', function (Blueprint $table) { $table->string('id', 100)->primary(); $table->integer('user_id')->unsigned(); $table->timestamp('created_at'); @@ -27,6 +27,6 @@ class CreatePasswordTokensTable extends Migration */ public function down() { - Schema::drop('password_tokens'); + $this->schema->drop('password_tokens'); } } diff --git a/framework/core/migrations/2015_02_24_000000_create_permissions_table.php b/framework/core/migrations/2015_02_24_000000_create_permissions_table.php index bece8cf5e..c62cc179f 100644 --- a/framework/core/migrations/2015_02_24_000000_create_permissions_table.php +++ b/framework/core/migrations/2015_02_24_000000_create_permissions_table.php @@ -1,7 +1,7 @@ schema->create('permissions', function (Blueprint $table) { $table->integer('group_id')->unsigned(); $table->string('permission', 100); @@ -29,6 +29,6 @@ class CreatePermissionsTable extends Migration */ public function down() { - Schema::drop('permissions'); + $this->schema->drop('permissions'); } } diff --git a/framework/core/migrations/2015_02_24_000000_create_posts_table.php b/framework/core/migrations/2015_02_24_000000_create_posts_table.php index a811973d6..6df6f3839 100644 --- a/framework/core/migrations/2015_02_24_000000_create_posts_table.php +++ b/framework/core/migrations/2015_02_24_000000_create_posts_table.php @@ -1,7 +1,7 @@ schema->create('posts', function (Blueprint $table) { $table->increments('id'); $table->integer('discussion_id')->unsigned(); $table->integer('number')->unsigned()->nullable(); @@ -34,7 +34,8 @@ class CreatePostsTable extends Migration $table->engine = 'MyISAM'; }); - app('db')->statement('ALTER TABLE posts ADD FULLTEXT content (content)'); + $prefix = $this->schema->getConnection()->getTablePrefix(); + $this->schema->getConnection()->statement('ALTER TABLE '.$prefix.'posts ADD FULLTEXT content (content)'); } /** @@ -44,6 +45,6 @@ class CreatePostsTable extends Migration */ public function down() { - Schema::drop('posts'); + $this->schema->drop('posts'); } } diff --git a/framework/core/migrations/2015_02_24_000000_create_users_discussions_table.php b/framework/core/migrations/2015_02_24_000000_create_users_discussions_table.php index c0604c03e..1c16b841d 100644 --- a/framework/core/migrations/2015_02_24_000000_create_users_discussions_table.php +++ b/framework/core/migrations/2015_02_24_000000_create_users_discussions_table.php @@ -1,7 +1,7 @@ schema->create('users_discussions', function (Blueprint $table) { $table->integer('user_id')->unsigned(); $table->integer('discussion_id')->unsigned(); $table->dateTime('read_time')->nullable(); @@ -30,6 +30,6 @@ class CreateUsersDiscussionsTable extends Migration */ public function down() { - Schema::drop('users_discussions'); + $this->schema->drop('users_discussions'); } } diff --git a/framework/core/migrations/2015_02_24_000000_create_users_groups_table.php b/framework/core/migrations/2015_02_24_000000_create_users_groups_table.php index 4b972576a..625e40247 100644 --- a/framework/core/migrations/2015_02_24_000000_create_users_groups_table.php +++ b/framework/core/migrations/2015_02_24_000000_create_users_groups_table.php @@ -1,7 +1,7 @@ schema->create('users_groups', function (Blueprint $table) { $table->integer('user_id')->unsigned(); $table->integer('group_id')->unsigned(); @@ -29,6 +29,6 @@ class CreateUsersGroupsTable extends Migration */ public function down() { - Schema::drop('users_groups'); + $this->schema->drop('users_groups'); } } diff --git a/framework/core/migrations/2015_02_24_000000_create_users_table.php b/framework/core/migrations/2015_02_24_000000_create_users_table.php index 1666c4e86..0af2fe3e1 100644 --- a/framework/core/migrations/2015_02_24_000000_create_users_table.php +++ b/framework/core/migrations/2015_02_24_000000_create_users_table.php @@ -1,7 +1,7 @@ schema->create('users', function (Blueprint $table) { $table->increments('id'); $table->string('username', 100)->unique(); $table->string('email', 150)->unique(); @@ -39,6 +39,6 @@ class CreateUsersTable extends Migration */ public function down() { - Schema::drop('users'); + $this->schema->drop('users'); } } diff --git a/framework/core/src/Install/Migration.php b/framework/core/src/Install/Migration.php new file mode 100644 index 000000000..a038191ae --- /dev/null +++ b/framework/core/src/Install/Migration.php @@ -0,0 +1,16 @@ +schema = $builder; + } +}