laravel migration default value code example
Example 1: laravel migration set default value
$table->string('name')->default('Hello World!');
Example 2: mysql timestamp in laravel migration
$table->timestamp('created_at')->default(DB::raw('CURRENT_TIMESTAMP'));
Example 3: sequelize migration default value
queryInterface.addColumn('OrderBackups', 'my_column', {
type: Sequelize.INTEGER,
defaultValue: 0
})
Example 4: laravel migration change default value
Schema::table('users', function ($table) {
$table->integer('active')->default(0)->change();
});