Mego's avatar
Level 1

Migrate whole database with Laravel-5-Generator

I want to use this: https://github.com/laracasts/Laravel-5-Generators-Extended

I have a large MySQL database with more than 100 tables and thousends of rows. I need to make a migration of it and make a database/migrations file, where will be everything (siže of file is irrelevant). Then I need to migrate whole database with all tables,values,keys,... into SQLite to start testing there. Can somebody help me, how can I make migration all-in-one file? Thank you for help

0 likes
7 replies
Mego's avatar
Level 1

I need to get migration files. Or is there another way?

I know, I can download full SQL dump (it would be maybe 450MB). But how can I import that file to SQLite after that?

mstnorris's avatar

You just insert it as SQL statements, when you export it, if you're using a GUI, then usually you'd be able to specify that you want a new INSERT INTO ... statement every 1000 rows, or every 1MB for example.

May I ask why you are using set data and not test/dummy data?

If you write your tests and validation correctly then it shouldn't matter what data you're testing with, as you will know whether or not it works because the tests will either pass or fail.

Mego's avatar
Level 1

It's dummy data. Too stupid dummy data :D For example, in table players I have got more than 45000 players. In table of matches there are only three matches. I can't do any changes in database, because the same database is shared by Java developers, testers, etc. (I don't understand, why the test must write me, not tester...)

I wrote, that size of file is irrelevant. So the only problem I have now, it's about exporting new database. I am using MySQL database, GUI is MySQL Workbench. I can download all tables, schemas, values, keys, properties... in one file, called database.sql. That's what I want, and that's what I know to do.

But the problem is, that I don't know, how can I import that file after that. How can I import that file into SQLite? SQLite hasn't GUI... So how can I upload this file into SQLite and make the data in SQLite the same as data in MySQL? That's my only problem.

mstnorris's avatar

Why are you using SQLite to test then? Is that a specification? Could you not just set up another MySQL database and import directly into that?

Mego's avatar
Level 1

No. I am afraid it's in specification, that we should make tests with SQLite.

Please or to participate in this conversation.