This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.
Hello i tryed to create simple plugin with database. php artisan create:plugin Foo.Bar php artisan create:model Foo.Bar Post
and update migration file, but how can i create table from migration?
php artisan plugin:refresh Foo.Bar and nothing happend (table not exists in database), what wrong ?
php artisan plugin:refresh Foo.Bar
Rolled back: Foo.Bar
Reinstalling plugin...
Foo.Bar
-
Nothing to update.
class CreatePostsTable extends Migration {
public function up() {
Schema::create('foo_bar_posts', function($table) { $table->engine = 'InnoDB'; $table->increments('id'); $table->integer('user_id')->unsigned()->nullable()->index(); $table->string('title')->nullable(); $table->string('slug')->index(); $table->text('content')->nullable(); $table->text('content_html'); $table->timestamp('published_at')->nullable(); $table->boolean('published')->default(false); });
}
public function down() {
Schema::drop('foo_bar_posts');
}
}
Last updated
I got the same problem. I've now spend more than 4 hours trying to get Artisan/October to play nice. This include reinstalling October and writing several test cases. I can't get it to migrate a model or my migration files "class CreateUserImagesTable extends Migration" for instance.
The plugin was created using Artisan create:plugin and the correct "update folder" was made including the migration file.
I've tried to
- renamed the migration files to fit with the normal laravel migration filename,
- using the "path" argument to Artisan
- creating models
- Using Artisan October:Up
- Using Artisan October:update
- Updating from backend
- Using the same "up" script in a normal artisan migration (that worked)
Any help will be valued, I can not develop my scripts if I can't update my models ..
Søren
@sorentruelsen339 lets see http://octobercms.com/forum/post/develop-new-plugin-troubles-2
and update your version.yaml and add you migration filenames to file
1-3 of 3