mpociot / teamwork

User to Team associations with invitation system for the Laravel 5 Framework
MIT License
1.07k stars 170 forks source link

PostgreSQL migration error #24

Closed hopewise closed 8 years ago

hopewise commented 8 years ago

I am using postgres, in the migration I got this error:

 [Illuminate\Database\QueryException]
  SQLSTATE[42601]: Syntax error: 7 ERROR:  zero-length delimited identifier at or near """"
  LINE 1: alter table "" add column "current_team_id" integer null
                      ^ (SQL: alter table "" add column "current_team_id" integer null)

Any advice?

mpociot commented 8 years ago

Which version of teamwork do you use? Can you take a look at the migration file? It should use the users table:

Schema::table( 'users', function ( Blueprint $table ) {
        $table->integer( 'current_team_id' )->unsigned()->nullable();
} );
hopewise commented 8 years ago

Sorry, it turns out that Config::get( 'auth.table' ) results into blank value, as 'auth.table' is not defined in Config, I had to add \Config::set( 'auth.table', "users" ); to run the migrations..

By the way, where would I define 'auth.table' ?

mpociot commented 8 years ago

Looks like your migration is from an older version of this package, which was not optimized for laravel 5.2 - there's still an open PR that I need to look at. In the meantime you can just set it to your users table name. Probably just users :)

hopewise commented 8 years ago

Ok, thank you :+1: