Comments (26)
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.
@mattvb91 I think for questions like this there is a separated regexp forums and the Zephir repo
from migrations.
Thanks @sergeyklay will check in there, thought it would be relevant here as its for the implementation of this issue 👍
from migrations.
Two months and nothing? C'mon!
from migrations.
You can to do it. I'll try to review
from migrations.
from migrations.
Related to the:
from migrations.
Any updates? 2 years have passed...
from migrations.
@sergeysviridenko Could you please deal with this
from migrations.
@dronezzzko I'll try to sort out with this as soon as possible.
from migrations.
hello guys! any updated on fixing ENUM, maybe ETA?
from migrations.
@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.
@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.
@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.
Wow, I'm surprised this project is still going! I thought it was dead!
from migrations.
@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.
@markhilton you can use connection with query in migration up method
from migrations.
@sergeysviridenko Could you please deal with this
from migrations.
Ok. I'll try to sort out.
from migrations.
We'll try to implement in 4.0.x branch
from migrations.
Any quick fix for this stupid issue?
from migrations.
@cryptolio there it can't be quick. We will try to implement it in 4.0.0 branch.
from migrations.
What about SET type?
from migrations.
Related #9
from migrations.
Implemented in #55
from migrations.
Released in v1.1.7
from migrations.
Related Issues (20)
- [FEATURE] In migration generation , add const table name instead of string in morphTable
- [BUG] change column unsigned didnt work
- [BUG] Cannot see existing migrations HOT 3
- [PGsql] Column::TYPE_DOUBLE - Unrecognized PostgreSQL data type at column weight. HOT 1
- [PGsql] Index should be primary key , instead of Normal Index HOT 4
- [PGsql] Column default function value HOT 2
- [NFR] Documentation : the structure and life cycle. HOT 2
- generating migration for Postgres does not create indexes HOT 2
- Missing ROW_FORMAT option HOT 1
- [BUG] Columns are scrambled when using TEXT data type HOT 2
- Add support for Phalcon 5 HOT 1
- Migration run wouldn't create mysql view HOT 3
- Phalcon migration error call_user_func_array HOT 1
- Wrong column size for numeric columns in MySQL
- Do not throw error when migrations folder is empty
- [NFR] Support migration generation with timestamp based versions HOT 1
- [NFR] Support BIT column type
- [BugFix] Migration log index size fix
- [BugFix] "Fatal Error: Typed property Phalcon\Migrations\Version\IncrementalItem::$path must not be accessed before initialization"
- Shift minimum PHP support to v8.0
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from migrations.