Comments (7)
How do you generate migration?
from migrations.
using phalcon dev tools.
phalcon migration generate
from migrations.
And what phalcon version?
from migrations.
As a far as I know it should work ok https://github.com/phalcon/cphalcon/blob/master/tests/integration/Db/Dialect/Postgresql/AddPrimaryKeyCest.php
from migrations.
Can we move this issue to the devtools?
from migrations.
In PostgreSQL, primary keys are located inside columns body during table creation.
CREATE TABLE "table" (
"id" INTEGER NOT NULL,
PRIMARY KEY ("id")
);
Which generates current code
$this->morphTable('table', [
'columns' => [
new Column(
'id',
[
'type' => Column::TYPE_INTEGER,
'primary' => true,
'notNull' => true,
'first' => true
])
],
]
);
So use 'primary' => true
to make column primary.
from migrations.
Fixed in #44
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.