# |
Jul 13th 2021, 17:25 |
tyler.adam.lazenby |
is there a way to call seeds within a migration? |
# |
Jul 13th 2021, 16:38 |
kevin.pfeifer |
sometimes they work pretty well :) |
# |
Jul 13th 2021, 16:37 |
tyler.adam.lazenby |
You got gifs to work huh? |
# |
Jul 13th 2021, 16:35 |
kevin.pfeifer |
calm down |
# |
Jul 13th 2021, 16:31 |
tyler.adam.lazenby |
HistoryTypesSeed and MessageTypesSeed |
# |
Jul 13th 2021, 16:31 |
tyler.adam.lazenby |
I was running two different seeds and didn't even realize |
# |
Jul 13th 2021, 16:31 |
tyler.adam.lazenby |
Nevermind guys |
# |
Jul 13th 2021, 16:29 |
tyler.adam.lazenby |
it does that |
# |
Jul 13th 2021, 16:28 |
tyler.adam.lazenby |
even if I truncate it |
# |
Jul 13th 2021, 16:25 |
tyler.adam.lazenby |
yes |
# |
Jul 13th 2021, 16:25 |
kevin.pfeifer |
does your `id` column have a `AUTO_INCREMENT` on it? |
# |
Jul 13th 2021, 16:23 |
tyler.adam.lazenby |
if I remove the duplicate |
# |
Jul 13th 2021, 16:23 |
tyler.adam.lazenby |
the email is duplicated yes but the seed still fails |
# |
Jul 13th 2021, 16:23 |
tyler.adam.lazenby |
nevermind |
# |
Jul 13th 2021, 16:23 |
tyler.adam.lazenby |
goddamnit |
# |
Jul 13th 2021, 16:23 |
tyler.adam.lazenby |
oh wait |
# |
Jul 13th 2021, 16:22 |
tyler.adam.lazenby |
```$data = [ [ 'name' => 'Email', 'description' => 'Emails sent to contact', ], [ 'name' => 'Text', 'description' => 'Texts sent to contact', ], [ 'name' => 'Other', 'description' => 'Other histories', ], [ 'name' => 'Email', 'description' => 'Email sent to contact', ] ];``` |
# |
Jul 13th 2021, 16:22 |
tyler.adam.lazenby |
But my seed doesn't even reference the primary key |
# |
Jul 13th 2021, 16:22 |
tyler.adam.lazenby |
Integrity constraint violation: 1062 Duplicate entry '1' for key 'PRIMARY' in C:\Users\TylerLazenby\Documents\ezBusinessManager2\vendor\robmorgan\phinx\src\Phinx\Db\Adapte r\PdoAdapter.php on line 339 |
# |
Jul 13th 2021, 16:22 |
tyler.adam.lazenby |
but the issue now is that I am running into this |
# |
Jul 13th 2021, 16:22 |
tyler.adam.lazenby |
I am running seeds and I had to drop the data from the table so that I could reseed in test |
# |
Jul 13th 2021, 16:22 |
tyler.adam.lazenby |
I am also running into something else |
# |
Jul 13th 2021, 15:57 |
dereuromark |
based on the current activity just reporting might not get it fixed any time soon I would recommend a PR directly, if you want to have this rather sooner than later. |
# |
Jul 13th 2021, 15:54 |
tyler.adam.lazenby |
should I report that? |
# |
Jul 13th 2021, 15:50 |
dereuromark |
sounds like a bug then |
# |
Jul 13th 2021, 15:48 |
richard |
oh |
# |
Jul 13th 2021, 15:47 |
tyler.adam.lazenby |
`bin/cake bake migration_snapshot Initial` |
# |
Jul 13th 2021, 15:47 |
richard |
how exactly did you create it via the migrations plugin |
# |
Jul 13th 2021, 15:46 |
tyler.adam.lazenby |
but the first was actually created by the migrations plugin |
# |
Jul 13th 2021, 15:46 |
tyler.adam.lazenby |
```->addColumn('updated', 'datetime', [ 'default' => 'CURRENT_TIMESTAMP', 'limit' => null, 'null' => false, ])``` |
# |
Jul 13th 2021, 15:46 |
tyler.adam.lazenby |
It will work if I mass change it to this |
# |
Jul 13th 2021, 15:45 |
tyler.adam.lazenby |
```->addColumn('updated', 'datetime', [ 'default' => 'current_timestamp()', 'limit' => null, 'null' => false, ])``` |
# |
Jul 13th 2021, 15:45 |
kevin.pfeifer |
I can’t find any valid php function which is called `current_timestamp()` Or do you mean the MySQL function? |
# |
Jul 13th 2021, 15:41 |
tyler.adam.lazenby |
Is there a reason why the default value for datetime `current_timestamp()` is (a) generated by the snapshot command in migrations and (b) the system considers that invalid? |
# |
Jul 13th 2021, 14:59 |
tyler.adam.lazenby |
gosh dang it, I have to use an app_local file |
# |
Jul 13th 2021, 14:57 |
richard |
tired of doing sudo mysql then creating dbs/etc |
# |
Jul 13th 2021, 14:57 |
richard |
I was thinking as some sort of dev ops chain but honestly i haven’t done that either, it’s something i want to start doing more often though |
# |
Jul 13th 2021, 14:56 |
tyler.adam.lazenby |
init script huh? I have never done one of those |
# |
Jul 13th 2021, 14:55 |
richard |
also might be weird, yeah, so you’re better off just doing that part yourself as some sort of init script or something |
# |
Jul 13th 2021, 14:55 |
tyler.adam.lazenby |
yeah, but the thing about that is... migrations rufuses to run if it can't find a database connection |
# |
Jul 13th 2021, 14:55 |
richard |
i don’t think there is a db-agnostic way to do it though |