Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
    Thank you for your answer Rob :)
    @caioguedes, I would say yes
    Just do it ! ;p
    Rob Morgan
    FYI - We are doing away with individual development branches. master will shortly become the default again.
    Ah great !
    It will clearly make contributions easier :smile:
    How can I write tinyint(2) with phinx?
    Hello @BassemN !
    Are you using MySQL as DBMS ?
    I know you can add a column as tinyint by writing something like that :
    $table->addColumn('myfield', 'integer', ['limit' => MysqlAdapter::INT_TINY])->save();
    but the limit is setted to 4 on my environment
    I don't think you can specify it via Phinx's adapters
    Jeroen Stolp
    I'm trying to run a migration though Phinx, i have some NUL bytes in my data (it's a JSON) field.
    Doesn Phinx support the ~* operator? the query runs fine if i execute it in psql but using the same statement in phinx doesn't yield results
    $result = $this->fetchAll("SELECT * FROM table WHERE column::text ~* '[^\\\\]\\u0000'");
    Nick D
    Hello everyone. Thank you for making a great product like Phinx, but I do have a question. I was wondering how to add a stored procedure to my migration? I need one, and I can't find anything in the documentation
    Jeroen Stolp
    Heey Nick, its not possible using shorthand functions like $table->create()
    But you can use the $this->execute ('CREATE STORED ...'); to run any arbitrary SQL. Even invoke or create a SP as far as I know.
    Haven't tested it myself but it'll accept any SQL you feed it and passes it on to the DB and returns number of affected rows.
    John Congdon
    Hi all, no rush, but I was wondering what the release schedule is? My PR was just merged to master today, but I'm wondering when it will be picked up my composer without resorting to dev-master.
    Hello, just wanted to clear up some misunderstanding on my part. I see that it has support for multiple environments. How can I make migration files choose certian databases
    My bad. Was typing this then realized what the solution might be. But accidentally submitted the msg.
    Hello there, just got a question. How does this library work with multiple databases? My understanding is that on the phinx.yml the enviroments are different database servers which may have different logins etc. But I cant understand how in the migration file you specific what table belong to what database. This question is for the table object functionality, as im guessing with raw sql statements you can use USE DATABASE statement.
    Phiter Fernandes
    hey dudes
    and girls
    I have a question. We're thinking about starting to use phinx (we don't use migrations yet)
    the database is already quite huge and we can't generate migrations for every table and stuff, and the generator that I found isn't compatible with our Mysql version
    my idea is to generate a SQL only of the database structure, and use it as a first migration, to generate in case your database is empty
    how could I do that? What would I need to set up to make it so the first migration is not executed in the production server, where the database is already done, for example? Or maybe I can ignore it since it'll validate if the tables exist. What do you guys think:?


    the generator that I found isn't compatible with our Mysql version

    what did you try? i just recently used&updated a MySQL2Phinx-fork -- even supports VIEW┬┤s on experimental https://github.com/tabakhase/MySQL2Phinx/tree/experimental

    What would I need to set up to make it so the first migration is not executed in the production server

    manually create the phinxlog table and mark the migration as "done" in there

    Phiter Fernandes
    @tabakhase I made some changes to add support for set and float, and it worked
    Phiter Fernandes
    hey guys
    damn no new messages after all this time
    so we're using phinx here now and we just came to a problem
    I have created a first_migration that has all the tables in the database, and then a migration that picks data from the production server and inserts locally after the first migration. After that there are some new migrations, and the issue we're having now is that one of these tables that are read in the seeder migration has been changed by a migration
    so now the production server has a new column that the first migration doesn't create, and when we run the seeder, it throws an unknown column error
    idk what to do
    Phiter Fernandes
    alright so I got into a different solution
    I removed the dependency of getting data from the production server and put those default data in json files, since when we add new data to those tables it's done trough new migrations
    Marcos Dantas
    hi everybody.
    all is ok ?
    guy's when develop new skeleton to my applications on various lib's based..
    i think use phinx to manage migrations...
    but i not found some method to inject config on PhinxApplication without create a new Application and inject all commands phinx with -c argument passed..
    someone tried it sometimes ? whats ways to go ?
    J. King
    Is there a particular reason not to use array casts, from a stylistic perspective? I'd like to shore up Phinx's SQLite tests, and there's some very low-hanging fruit with conversion from strings to arrays.
    J. King
    Also, is there any minimum version of any database which Phinx targets?
    Mark Sch.
    Are people in here still? :)