Skip to content

Generated migration includes extra parenthesis #194

@kreeves

Description

@kreeves

Steps to reproduce:

  1. Create draft.yaml file like below
  Team:
    name: string:400

  ScheduledGame:
    homeTeam: id foreign:teams
    awayTeam: id foreign:teams
    scheduled: dateTimeTz
  1. Run php artisan blueprint:build
  2. Run php artisan migrate
  3. Observed behavior:
Expand to see error.

ParseError

syntax error, unexpected ')'

at database/migrations/2020_05_08_142800_create_scheduled_games_table.php:18
14| public function up()
15| {
16| Schema::create('scheduled_games', function (Blueprint $table) {
17| $table->id();

18| $table->foreignId('homeTeam')->constrained('teams', 'homeTeam')->cascadeOnDelete());
19| $table->foreignId('awayTeam')->constrained('teams', 'awayTeam')->cascadeOnDelete());
20| $table->dateTimeTz('scheduled');
21| $table->timestamps();
22| });

  +19 vendor frames

20 artisan:37
Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions