# |
May 27th 2016, 09:58 |
TheMiller |
Thanks@all! |
# |
May 27th 2016, 09:57 |
Neon1024x |
D |
# |
May 27th 2016, 09:57 |
TheMiller |
That was the Problem. Wow, everything has been created. |
# |
May 27th 2016, 09:57 |
TheMiller |
bin/cake bake migration My-Migration |
# |
May 27th 2016, 09:57 |
TheMiller |
ah stop. sry, my fault |
# |
May 27th 2016, 09:57 |
Neon1024x |
bin/cake bake migration MyMigration |
# |
May 27th 2016, 09:57 |
Neon1024x |
So you're running something like |
# |
May 27th 2016, 09:57 |
TheMiller |
Which classname? |
# |
May 27th 2016, 09:56 |
TheMiller |
ok that solved the problem, but now diff says: Your migrations history is empty and you do not have any migrations files. Falling back to baking a snapshot... Error: The className is not correct. The className can only contain "A-Z" and "0-9". |
# |
May 27th 2016, 09:56 |
Neon1024x |
Perhaps its just that you have migrations listed in your phinxlog table which don't exist in config/Migrations |
# |
May 27th 2016, 09:55 |
Neon1024x |
You don't need a migration snapshot, but it's handy if you want to recreate the whole db schema |
# |
May 27th 2016, 09:55 |
TheMiller |
yes sorry ;) |
# |
May 27th 2016, 09:55 |
hmic |
truncate, yes. |
# |
May 27th 2016, 09:54 |
TheMiller |
may I flush the phinx-tables? |
# |
May 27th 2016, 09:54 |
Neon1024x |
Odd, I've never seen that error before |
# |
May 27th 2016, 09:54 |
fquffio |
Oh, then you must `bin/cake bake migration_snapshot initial` first. :slightly_smiling_face: |
# |
May 27th 2016, 09:54 |
TheMiller |
yes. |
# |
May 27th 2016, 09:54 |
bernat1 |
hmmm |
# |
May 27th 2016, 09:54 |
Neon1024x |
Using bin/cake bake migration right? |
# |
May 27th 2016, 09:54 |
bernat1 |
how do you make a diff? |
# |
May 27th 2016, 09:54 |
TheMiller |
There are no available migrations. Try creating one using the create command. |
# |
May 27th 2016, 09:53 |
TheMiller |
Thanks @all so far. migrations status says - nothing to do |
# |
May 27th 2016, 09:53 |
Neon1024x |
TheMiller, You might want to bake a migration snapshot, or try bin/cake migrations status |
# |
May 27th 2016, 09:52 |
bernat1 |
TheMiller: look for a phinxlog table |
# |
May 27th 2016, 09:52 |
fquffio |
TheMiller: I'm not sure, but probably `bin/cake migrations mark_migrated` is what you're looking for. |
# |
May 27th 2016, 09:52 |
TheMiller |
3.2.9 |
# |
May 27th 2016, 09:52 |
Neon1024x |
TheMiller, What version of cake? |
# |
May 27th 2016, 09:52 |
bernat1 |
thanks @fquffio |
# |
May 27th 2016, 09:51 |
bernat1 |
I'm looking at core behaviors and I wondered if $this->_table was the correct way to use it in plugins. It seems so. Thanks. |
# |
May 27th 2016, 09:51 |
fquffio |
bernat1: You might take a look at `TranslateBehavior`: it adds some associations on-the-fly to deal with translated fields (https://github.com/cakephp/cakephp/blob/master/src/ORM/Behavior/TranslateBehavior.php) |
# |
May 27th 2016, 09:51 |
Neon1024x |
dariolap, I mean if you're against glob try this , http://book.cakephp.org/3.0/en/core-libraries/file-folder.html |
# |
May 27th 2016, 09:51 |
dariolap |
Neon1024x, ok i use it! if there was a cakephp method, I would rather use it |
# |
May 27th 2016, 09:51 |
TheMiller |
Hello! I want to start using migrations. Didn't used them before but played around a little. Now I want to make a diff and console says me: "Your migrations history is not in sync with your migrations files. Make sure all your migrations have been migrated before baking a diff." How can I clean the history? |
# |
May 27th 2016, 09:50 |
Neon1024x |
dariolap, Why not just use glob() |
# |
May 27th 2016, 09:50 |
bernat1 |
I'd like to configure the behavior as if I was creating a special kind of association. |
# |
May 27th 2016, 09:50 |
Neon1024x |
I believe that the behaviour has $this->_table is the table it's attached to |
# |
May 27th 2016, 09:50 |
dariolap |
in 3.x there is a function to simulate php glob ? |
# |
May 27th 2016, 09:49 |
Neon1024x |
It's addAssociations() with an array of all the associtations, or you can just $table->belongsTo() as you would normall |
# |
May 27th 2016, 09:49 |
Neon1024x |
Ah so yeah, my bad |
# |
May 27th 2016, 09:49 |
Neon1024x |
https://github.com/cakephp/cakephp/blob/master/src/ORM/Table.php#L669-L707 |
# |
May 27th 2016, 09:48 |
bernat1 |
I want to create a behavior that eases saving some fields as hashes in another table. |