Coder Social home page Coder Social logo

Comments (26)

mattvb91 avatar mattvb91 commented on May 30, 2024

Can anyone else help with the regex in zephir to get just the values out of something like:

enum('test', 'test1', 'test(2)', 'test3')

from migrations.

sergeyklay avatar sergeyklay commented on May 30, 2024

@mattvb91 I think for questions like this there is a separated regexp forums and the Zephir repo

from migrations.

mattvb91 avatar mattvb91 commented on May 30, 2024

Thanks @sergeyklay will check in there, thought it would be relevant here as its for the implementation of this issue 👍

from migrations.

marhub avatar marhub commented on May 30, 2024

Two months and nothing? C'mon!

from migrations.

sergeyklay avatar sergeyklay commented on May 30, 2024

You can to do it. I'll try to review

from migrations.

mattvb91 avatar mattvb91 commented on May 30, 2024

phalcon/cphalcon#11368

from migrations.

ChangePlaces avatar ChangePlaces commented on May 30, 2024

Related to the:

from migrations.

dronezzzko avatar dronezzzko commented on May 30, 2024

Any updates? 2 years have passed...

from migrations.

sergeyklay avatar sergeyklay commented on May 30, 2024

@sergeysviridenko Could you please deal with this

from migrations.

sergeysviridenko avatar sergeysviridenko commented on May 30, 2024

@dronezzzko I'll try to sort out with this as soon as possible.

from migrations.

markhilton avatar markhilton commented on May 30, 2024

hello guys! any updated on fixing ENUM, maybe ETA?

from migrations.

sergeysviridenko avatar sergeysviridenko commented on May 30, 2024

@markhilton Sorry, but at the moment there isn't any update. Enum field is specific field for MySQL db. Command migration creates files which can be use on different DB. For example - if we create migration with ENUM field, we won't use it on PostgreSQL db. Do you have any proposition about implementing this field?

from migrations.

markhilton avatar markhilton commented on May 30, 2024

@sergeysviridenko nope, I just ported a database to Phalcon and noticed this error while doing migrations, so wanted to get an update to determine direction for my project. Thanks for taking time to answer, appreciate it!

from migrations.

amnuts avatar amnuts commented on May 30, 2024

@sergeysviridenko I wouldn't say that they're specific to MySQL. PostgreSQL has enums, but beyond that others may not (eg, Oracle or SqlServer).

Perhaps you could generate a comment block for the specific db type on which the migration generation was run? Chances are someone is doing that because they're wanting to track the changes to their db structure and will retain that db type rather than running migration in order to change db type. So having the specific items in there - even if commented out - would be really handy for the user who can then just remove the comments.

For example:

    public function morph()
    {
        $this->morphTable('users', [
                'columns' => [
                    new Column(
                        'id',
                        [
                            'type' => Column::TYPE_INTEGER,
                            'unsigned' => true,
                            'notNull' => true,
                            'autoIncrement' => true,
                            'size' => 11,
                            'first' => true
                        ]
                    ),
                    /*
                     * MySQL DB migration
                     * This field type was automatically generated from a MySQL
                     * instance.  Using this to migrate to another database type
                     * is not guaranteed to work.  We have supplied a generic
                     * version below, or you can manually replace the generic
                     * field with the following if you remain on MySQL:
                     *
                     *    new Column(
                     *       'level',
                     *       [
                     *           'type' => Column::TYPE_ENUM,
                     *           'default' => "guest",
                     *           'notNull' => true,
                     *           'size' => 1,
                     *           'after' => 'id',
                     *           'value' => "'guest','user','super','admin'"
                     *       ]
                     *   )
                     *
                     */
                    new Column(
                        'level',
                        [
                            'type' => Column::TYPE_CHAR,
                            'default' => "none",
                            'notNull' => true,
                            'size' => 1,
                            'after' => 'id'
                        ]
                    )
                ],
                'indexes' => [
                    new Index('PRIMARY', ['id'], 'PRIMARY')
                ],
                'options' => [
                    'TABLE_TYPE' => 'BASE TABLE',
                    'AUTO_INCREMENT' => '',
                    'ENGINE' => 'InnoDB',
                    'TABLE_COLLATION' => 'utf8mb4_bin'
                ],
            ]
        );
    }

From the documentation it looks like you support some MySQL & PostgeSQL specific things such as onDelete/onUpdate, so it wouldn't be too far outside of that to put in column-specific stuff even without the comment.

from migrations.

ChangePlaces avatar ChangePlaces commented on May 30, 2024

Wow, I'm surprised this project is still going! I thought it was dead!

from migrations.

amnuts avatar amnuts commented on May 30, 2024

@ChangePlaces hope not, because I've only just started to use Phalcon and its migrations! Does seem to have gone on for quite some time, though - a couple years at least? There seems to be an assumption that the tool can only be generic and support all databases and not give the specifics that the user may choose to use because it suits their needs. I'd rather it works so that I can track all the changes required in the db structure for my project, which runs on the db platform of my choosing, and will never be distributed - which means db-specific support where needed.

from migrations.

beatwade avatar beatwade commented on May 30, 2024

@markhilton you can use connection with query in migration up method

from migrations.

sergeyklay avatar sergeyklay commented on May 30, 2024

@sergeysviridenko Could you please deal with this

from migrations.

sergeysviridenko avatar sergeysviridenko commented on May 30, 2024

Ok. I'll try to sort out.

from migrations.

sergeysviridenko avatar sergeysviridenko commented on May 30, 2024

We'll try to implement in 4.0.x branch

from migrations.

cryptolio avatar cryptolio commented on May 30, 2024

Any quick fix for this stupid issue?

from migrations.

sergeysviridenko avatar sergeysviridenko commented on May 30, 2024

@cryptolio there it can't be quick. We will try to implement it in 4.0.0 branch.

from migrations.

maxttor avatar maxttor commented on May 30, 2024

What about SET type?

from migrations.

Jeckerson avatar Jeckerson commented on May 30, 2024

Related #9

from migrations.

Jeckerson avatar Jeckerson commented on May 30, 2024

Implemented in #55

from migrations.

Jeckerson avatar Jeckerson commented on May 30, 2024

Released in v1.1.7

from migrations.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.