Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Composer install error #40

Open
hmonglee opened this issue Oct 25, 2018 · 4 comments
Open

Composer install error #40

hmonglee opened this issue Oct 25, 2018 · 4 comments
Labels
help wanted Extra attention is needed

Comments

@hmonglee
Copy link
Contributor

Hello, I get the last commit this morning and when I composer install :

In Connection.php line 664: SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "channels" does not exist LINE 1: select distinct "issuer" from "channels" ^ (SQL: select distinct "issuer" from "channels") In Connection.php line 330: SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "channels" does not exist LINE 1: select distinct "issuer" from "channels" ^ Script @php artisan package:discover handling the post-autoload-dump event returned with error code 1 Script cd rpc && composer install handling the post-install-cmd event returned with error code 1

Looks like Laravel try to register ServiceProvider when executing php artisan package:discover and the FatturaPa\Control\ControlServiceProvider includes routes/web.php which need to access to issuer table which does not already exist because we create tables after with php artisan migrate.

@simevo
Copy link
Collaborator

simevo commented Oct 28, 2018

I see that you tried to patch it with https://github.com/hmonglee/fatturapa-testsdi/commit/58eb47bfcab9ef96f92227a150fb018fadf719b2

another workaround proposed by @Pes8 is to comment this line:
https://github.com/italia/fatturapa-testsdi/blob/master/rpc/packages/fatturapa/control/src/ControlServiceProvider.php#L26
launch php artisan migrate then restore ControlServiceProvider.php and resume

a better fix would be to move the database migrations where they belong, i.e. to the core module

the core module does not have a full Laravel install hence php artisan migrate is not available, but there are ways to do it, is anybody brave enough for a PR ?

@simevo simevo added the help wanted Extra attention is needed label Oct 28, 2018
@Pes8
Copy link
Contributor

Pes8 commented Oct 29, 2018

I'm triyng to do it, using Phinx as migration library. (Its almost done)

Just one "problem"

Phinx use a different migrations version and migration table structure. So it can't use the laravel migrations table. Fresh installs are ok, how we handle the already migrated projects ? I'm thinking about a migration class that check and import rows from laravel migrations table into the new phynx format.

Solved this I think I can make a PR

@simevo
Copy link
Collaborator

simevo commented Oct 29, 2018

Many thanks !
As this project is pretty young and prominently displays the "WORK IN PROGRESS" banner, it's safe to assume it's not in production anywhere and people are setting it up and playing with it locally or in docker - so please go ahead and break existing installs !
In the meantime I also discovered this one: https://github.com/dwielocha/eloquent-migrations not sure whether it can help ...

@Pes8
Copy link
Contributor

Pes8 commented Oct 29, 2018

Well, I simple added a check before creating the tables in the migrations. It should be enough to don't break existing installs. Just made a PR.

simevo added a commit that referenced this issue Oct 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants