electrikhq / electrik

Electrik is a full-featured, open-source, starter-kit to help you build you your SaaS application.
https://electrik.dev
MIT License
254 stars 19 forks source link

Problem Running Migrations. (Cannot declare class TeamworkSetupTables, because the name is already in use) #13

Closed MusheAbdulHakim closed 1 year ago

MusheAbdulHakim commented 1 year ago

I can't run migrations because apparently some of the files have the same class name. database/migrations/2023_01_07_203947_teamwork_setup_tables.php:6 and database/migrations/2023_01_07_203242_teamwork_setup_tables.php

mardillu commented 1 year ago

@MusheAbdulHakim It appears running the php artisan electrik:install command more than once causes the migration files to be duplicated. You get different file names but exactly the same content, hence you get that error during the install. Deleting one may not solve the issue as you would still need to run the install command again.

One solutions is to start the installation over. At least, in my that solved the issue

MusheAbdulHakim commented 1 year ago

Thanks. That worked.

neerajsohal commented 1 year ago

Hi, @MusheAbdulHakim. The install command needs to be run only once. If you run it again it'll create problems with duplicate migration files. Let me think of a way to warn users if they try to re-run the install command.