deiucanta / laravel-smart

Automatic Migrations, Validation and More
48 stars 7 forks source link

Converting existing model to Smart model #10

Open deiucanta opened 6 years ago

deiucanta commented 6 years ago

Let's say you have the user model already. The migration is there and the database is up to date. You want to use Smart model from now on.

Converting the model will generate a new migration as if nothing was in the database. This happens because we didn't track previous states of the user model.

If we add a command that doesn't generate a new migration but updates the smart.json file, I think we should be good on this issue.

Am I missing anything?

robsontenorio commented 6 years ago

I consider this can messup things , because is dangerous.

I do prefer convert the project into smart models, delete all migrations file and generate then again with Smart.

deiucanta commented 6 years ago

@robsontenorio I know you are converting an existing project to use this package. Let us know how it goes.

Meanwhile, a few questions


There are two cases we need to support

robsontenorio commented 6 years ago

Just finished the project migration. It took about 1h with 25 models.

The process was smooth due to app automatic tests.

deiucanta commented 6 years ago

@robsontenorio 1h is pretty good!

robsontenorio commented 6 years ago