Posts

Showing posts with the label migration

rename column in laravel using migration

rename column in laravel using migration I use laravel 5.6 I want change author_ID to user_id author_ID user_id I have columns as mentioned bellow: class CreatePostsTable extends Migration{ public function up() { Schema::create('posts', function (Blueprint $table) { $table->increments('id'); $table->bigInteger('author_ID'); $table->bigInteger('category_ID')->nullable(); $table->longText('post_content'); $table->text('post_title'); $table->string('post_slug', 200); $table->string('post_type', 20); $table->timestamps(); }); } public function down() { Schema::dropIfExists('posts'); } } I use the below link to change my column name : How can I rename column in laravel using migration? then create blow migration : php artisan make:migration rename_aut...