# |
Jul 18th 2017, 15:30 |
jeremyharris |
I *wish* seeds were tracked like migrations. that’d be an amazing feature imo, keep the schema/data separate |
# |
Jul 18th 2017, 15:29 |
jeremyharris |
awi I don’t quite understand |
# |
Jul 18th 2017, 15:29 |
adriencs |
@genellern @jeremyharris thanks, next time I'll double-check the doc -_- |
# |
Jul 18th 2017, 15:29 |
cleptric |
I agree with @jeremyharris Seeds are nice to have for local development |
# |
Jul 18th 2017, 15:29 |
cleptric |
mic_ Ok, there are quite a few options on how to archive that. Unfortunately the upgrade from 2y -> 3.x is pretty rough |
# |
Jul 18th 2017, 15:29 |
jeremyharris |
just something to keep in mind |
# |
Jul 18th 2017, 15:29 |
jeremyharris |
seeds* |
# |
Jul 18th 2017, 15:29 |
jeremyharris |
sees are run each time though, they aren’t tracked like migrations |
# |
Jul 18th 2017, 15:28 |
awi |
if ($this->Users->delete($user)) { will go to else when i put $event->stopPropagation() ? jeremyharris |
# |
Jul 18th 2017, 15:28 |
genellern |
You can, but you should consider seedss |
# |
Jul 18th 2017, 15:28 |
adriencs |
can you add data with Migrations ? |
# |
Jul 18th 2017, 15:27 |
mic_ |
sorry, but backend is old. |
# |
Jul 18th 2017, 15:27 |
mic_ |
frontend is new (BS+jquery), but backend is. The app is relatively large, and upgrade costs are not peanuts, hence consideration. |
# |
Jul 18th 2017, 15:25 |
cleptric |
mic_ How big is your app? |
# |
Jul 18th 2017, 15:25 |
sonu-nk |
yes.. :) |
# |
Jul 18th 2017, 15:25 |
mic_ |
did anybody here upgrade from 1.2/1.3 to 2.x or 3.x? What would be the best strategy? (I want 1.2 -> 1.3 -> 2.10 and then decide whether to axe/start from scratch) |
# |
Jul 18th 2017, 15:24 |
cleptric |
Ok, then use the feature I mentioned above your question :slightly_smiling_face: |
# |
Jul 18th 2017, 15:24 |
sonu-nk |
suppose i want to shift my project on another host. now i cant install database there. but i want a command which can generate migration files for me.. so that i can run same migration file on another server and my datbase ready |
# |
Jul 18th 2017, 15:24 |
cleptric |
If so, use this https://book.cakephp.org/3.0/en/migrations.html#generating-migrations-from-an-existing-database |
# |
Jul 18th 2017, 15:23 |
cleptric |
Like an Initial migration? |
# |
Jul 18th 2017, 15:23 |
cleptric |
You want a migration that contains the whole database? |
# |
Jul 18th 2017, 15:22 |
cleptric |
What do you want to do exactly? :slightly_smiling_face: |
# |
Jul 18th 2017, 15:22 |
sonu-nk |
@cleptric https://book.cakephp.org/3.0/en/migrations.html#syntax i also saw that one.. but that one require to add table fields and datatype as command arguments |
# |
Jul 18th 2017, 15:22 |
jeremyharris |
though I’m not sure that’d be the best idea :slightly_smiling_face: |
# |
Jul 18th 2017, 15:22 |
genellern |
https://book.cakephp.org/3.0/en/migrations.html#dump-generating-a-dump-file-for-the-diff-baking-feature |
# |
Jul 18th 2017, 15:22 |
jeremyharris |
I could be wrong, but I think you can also stopPropagation and return a string which would set the “result” |
# |
Jul 18th 2017, 15:21 |
jeremyharris |
awi it’s not pretty, but you can add a public property to event, like $event->message = ‘message’; $event->stopPropagation(); or, you can add it to the event data |
# |
Jul 18th 2017, 15:21 |
cleptric |
https://book.cakephp.org/3.0/en/migrations.html#creating-migrations |
# |
Jul 18th 2017, 15:20 |
cleptric |
One second :slightly_smiling_face: |
# |
Jul 18th 2017, 15:20 |
sonu-nk |
@cleptric the same i did not find... i was looking at book... |
# |
Jul 18th 2017, 15:20 |
cleptric |
sonu-nk bake offers some stuff |
# |
Jul 18th 2017, 15:19 |
sonu-nk |
@genellern i am looking for the command or anything which can help me to generate migration files from my database table |
# |
Jul 18th 2017, 15:18 |
awi |
When I stop it, it will fail in the controller? |
# |
Jul 18th 2017, 15:18 |
awi |
ok... |
# |
Jul 18th 2017, 15:18 |
cleptric |
Sorry, i don’t know any elegant way to behonest |
# |
Jul 18th 2017, 15:18 |
cleptric |
Uhhh :thinking_face: |
# |
Jul 18th 2017, 15:17 |
awi |
can I somehow set a message when i use stoppropagation? |
# |
Jul 18th 2017, 15:16 |
genellern |
sonu-nk look at the dump option in the migrations plugin |
# |
Jul 18th 2017, 15:15 |
cleptric |
if you call `$event->stopPropagation()` this will stop the delete opration |
# |
Jul 18th 2017, 15:15 |
cleptric |
beforeDelete has a `$event` parameter |
# |
Jul 18th 2017, 15:14 |
awi |
or something like an return? |