Skip to content
This repository has been archived by the owner on Mar 9, 2019. It is now read-only.

php artisan migrate seems to fail #6

Closed
MarkSyred opened this issue Jan 5, 2017 · 5 comments
Closed

php artisan migrate seems to fail #6

MarkSyred opened this issue Jan 5, 2017 · 5 comments

Comments

@MarkSyred
Copy link

Hi there,

Thanks for developing and providing instructions for the installation of Clumsy.

I don't know if I'm posting this in the correct place, but I wonder if I could have some help with an aspect of the installation process. I should say first, that I am quite new to Laravel and am still getting my head around some of even the most basic stuff to do with it.

Anyway, I've followed your instructions and have got as far as adding a user and logging in to be presented with the

[Admin home] Clumsy is correctly set up.

message. I have yet to fix up the authenticated path and as yet have no idea how to. But, earlier on in the process, when I ran the

php artisan migrate

command, the following error messages greeted me:

[Illuminate\Database\QueryException] SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'performance_indicators' already exists (SQL: create table 'performance_indicators' ('id' int unsigned not null auto_increment primary key, 'monthly_recurring_revenue' decimal(8, 2) not null, 'yearly_recurring_revenue' decimal(8, 2) not null, 'daily_volume' decimal(8, 2) not null, 'new_users' int not null, 'created_at' timestamp null, 'updated_at' timestamp null) default character set utf8 collate utf8_unicode_ci)

and

[PDOException] SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'performance_indicators' already exists

We are trying to set up Clumsy alongside Spark on the same website so, it could be that there is some conflict at work here. But after a 'successful' install, when I visit (http://sypotest13.co.uk/admin/post) I get an error message telling me that a table named, 'posts,' does not exist.

So, is this because I have not yet defined the /admin route? Is this to do with trying to set up Clumsy alongside Spark? Or has something gone wrong with the php artisan migrate command?

Any help that anyone can provide with this would be most helpful and appreciated.

With kind regards,

Mark

@tbuteler
Copy link
Owner

tbuteler commented Jan 6, 2017

The performance_indicators belongs to Spark migrations, not Clumsy. I cannot think of a reason why it would error out with that message, unless it failed to register the migration in the appropriate table after running.

Have your tried clearing the database and starting over?

You don't necessarily need to define an admin route. Whatever route you add the clumsy middleware to will automatically become and "admin" environment.

I'll see if I can mix Spark and Clumsy sometime soon and get back to you. If in the meantime you make any progress, let me know.

@MarkSyred
Copy link
Author

Hi Tomas,

Thanks for getting back to me.

I'll see if I can mix Spark and Clumsy sometime soon and get back to you. If in the meantime you make any progress, let me know.

...meanwhile, I'm going to set up a completely fresh install of Laravel with just Clumsy on top and see what happens. Probably could have tried that before. But, it would be good if you could try mixing Spark and Clumsy to see what you get.

I await the results of your investigation with interest.

With kind regards,

Mark

@tbuteler
Copy link
Owner

tbuteler commented Jan 6, 2017

Hi Mark,

I've tested a fresh installation of Spark with Clumsy and was able to migrate back and forth without any problems. Can you backup your stuff and start over from scratch?

I'm guessing you had a problem during one of your migrations which prevented you from completing it, but your database was somehow compromised during the process.

Any other information you can provide would help to debug your particular case, but I'm confident this is not an issue with Clumsy itself.

@MarkSyred
Copy link
Author

Hi Tomas,

Thanks for your continued help with this.

I have realised something after having started from scratch with a fresh Laravel and just Clumsy...

After running php artisan clumsy:resource post the CLE came up with the following messages:

- Add this to your routes.php: Route::resource('post', 'PostsController');
and
- Add this to DatabaseSeeder.php: $this->call(PostsSeeder::class);

and I didn't quite know what to do with this stuff. I've now worked out that I didn't need to edit routes.php, but web.php, found in clumsy/routes, and the exact code I needed to add there, you provide in your instructions. The code for DatabaseSeeder.php was easy to add in.

Once I'd done that, running php artisan migrate was successful in creating the posts table and a visit to http://example.co.uk/admin/post showed me your CMS.

Thanks again for your help. It turns out there was no issue! Smashing.

With kind regards,

Mark

@tbuteler
Copy link
Owner

tbuteler commented Jan 6, 2017

The instructions to edit routes.php are outdated, thanks for pointing it out. I'll fix this when I have time. Glad to know you're issue is resolved!

@tbuteler tbuteler closed this as completed Jan 6, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants