laravel-migrations Questions

7

Solved

I want to write a Laravel Migration auto increment ID as a primary key. I want to start this ID with a another value rather than 1. How can I do so ? The migration up() function: public function...
Initiation asked 3/2, 2020 at 14:39

8

Solved

How would I set a database auto increment field that is not a primary key on the creation method? The only way is using a raw query? DB::statement('ALTER TABLE table CHANGE field field INT(10)AUT...
Scrim asked 21/3, 2017 at 14:21

6

Solved

First I rolled back 2 migrations by mistake, then I ran php artisan migrate command and I got the following error: [Illuminate\Database\QueryException] SQLSTATE[42S02]: Base table or view not fou...
Selectman asked 28/2, 2017 at 14:49

13

Solved

I am using Laravel 5 and getting the following exception: PDOException (1044) SQLSTATE[HY000] [1044] Access denied for user ''@'localhost' to database 'forge' My database configuration file i...
Calondra asked 1/5, 2015 at 12:11

7

Solved

I need to change with a migration column type of $table->string('text'); to a text type, I have tried to do that in a few ways, but none of them worked. Is it possible to do it in one migration?...
Eyecup asked 9/6, 2016 at 11:3

21

Solved

I can't figure out how to add a new column to my existing database table using the Laravel framework. I tried to edit the migration file using... <?php public function up() { Schema::create(...
Yacketyyak asked 28/5, 2013 at 12:3

12

Solved

I do not know why this error occurs when I execute the migrations as I do not have repeated classes. Migrations: 2014_10_12_100000_create_password_resets_table.php 2019_01_18_020910_create_roles_ta...
Organize asked 19/2, 2019 at 11:52

16

Solved

I have 5 migrations in my project. I only want to run one of these migrations. Is it possible to pass the name of a single file to the php artisan migrate command?
Teutonic asked 30/9, 2013 at 19:27

2

Solved

This is my current code. public function up() { Schema::table('render', function (Blueprint $table) { $table->boolean('displayed')->default(1); }); }` How to change the default value to...
Tomkin asked 24/4, 2018 at 7:20

6

Solved

I've just started with Laravel and I get the following error: Unknown column 'updated_at' insert into gebruikers (naam, wachtwoord, updated_at, created_at) I know the error is from the times...
Valonia asked 2/2, 2015 at 12:38

12

I created a migration with unsigned user_id. How can I edit user_id in a new migration to also make it nullable()? Schema::create('throttle', function(Blueprint $table) { $table->increments('i...
Dallapiccola asked 25/6, 2014 at 23:3

3

Solved

How to add comment to table (ot column) in Laravel 5 migration? I currently know how to add comment to column like: $table->tinyInteger('status')->comment('0: requested; -1: rejected; 1:con...
Mixtec asked 27/5, 2016 at 22:59

8

Solved

Can't figure out how to set the proper onDelete constraint on a table in Laravel. (I'm working with SQLite) $table->...->onDelete('cascade'); // works $table->...->onDelete('null || set...
Fleshy asked 1/1, 2014 at 13:23

2

Solved

I am trying to change a column from type string to integer on Postgres and Laravel 6.x. I've tried to do this with a migration like so: public function up() { Schema::table('job_listings', funct...
Interfluve asked 21/7, 2020 at 0:53

6

Solved

Table 'users': |id|name|address|post_code|deleted_at|created_at| and I want add column 'phone_nr' somewhere between 'id' and 'deleted_at' Is it possible by migrations in Laravel 4.1?
Progressive asked 7/1, 2014 at 21:43

3

I came here to expose the specific way that i found to run migrations into a Google Cloud Run project using Google Cloud SQL and Laravel, which is simple, i just connect from my .env laravel to Clo...

1

Solved

Is it possible to add a new column, copy some data to this new column and update the data in another column with a Laravel migration? I have a table something like this; id item price 1 Ite...

4

Solved

I have this migration file Schema::create('table_one', function(Blueprint $table) { $table->increments('id'); $table->string('name'); $table->integer('table_two_id')->unsigned();...
Elysian asked 18/7, 2016 at 2:6

7

Solved

Laravel's documentation recommends using the DatabaseMigrations trait for migrating and rolling back the database between tests. use Illuminate\Foundation\Testing\DatabaseMigrations; class Exampl...
Jarrell asked 20/2, 2017 at 16:52

2

I have two database configs, one for production and one for development: // app/config/database.php 'connections' => array( 'mysql' => array( 'driver' => 'mysql', 'host' => $_SERVER...

2

Solved

I have the following migration: <?php use Illuminate\Support\Facades\Schema; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; class UpdateRatingGameUser...
Ursa asked 25/2, 2019 at 12:42

5

Solved

Developers of my team are really used to the power of Laravel migrations, they are working great on local machines and our dev servers. But customer's database admin will not accept Laravel migrati...
Zimmerman asked 7/7, 2015 at 8:35

3

Solved

As mentioned in here, we can use the word cascade when making a relation in migrations but I wonder they didn't say anything about other actions when deleting or updating a foreign key so I'm not s...
Liquidator asked 15/9, 2016 at 18:38

9

Solved

I'm trying to run the migration (see below) and seed the database, but when I run php artisan migrate --seed I get this error: Migration table created successfully. Migrated: 2015_06_17_100000_...

4

Solved

I am trying to put laravel database migrations in sub folders, but not sure how to do this.
Lecythus asked 6/3, 2019 at 8:35

© 2022 - 2025 — McMap. All rights reserved.