![]() |
|
sfPostgresDoctrinePlugin - 1.0.9A postgres doctrine plugin. |
|
![]() |
6
users
Sign-in
to change your status |
The plugin that extends the sfDoctrinePlugin for Postgres database. |
This plugin transparently override behavior of sfDoctrinPlugin.
It gives you:
ability to have a real inheritance
schemas menagement
ability to omit tables in schema and model generation process
ability to have one to one relation in schema and models generating process
enums and objects menagement
behaviors menagement
views menagement
plugin model management
ability to use custom record class for all Doctrine_Record objects
ability to use custom table class for all Doctrine_Table objects
ability to use uppercase in names of schemas, tables and columns
| Name | Status | |
|---|---|---|
|
|
lead | lp.pw <<ta>> elezrtsm |
Copyright (c) 2010 Michał Strzelecki
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
| Version | License | API | Released |
|---|---|---|---|
| 1.2.26stable | MIT license | 1.2.26stable | 04/03/2011 |
| 1.2.25stable | MIT license | 1.2.25stable | 15/01/2011 |
| 1.2.24stable | MIT license | 1.2.24stable | 16/12/2010 |
| 1.2.23stable | MIT license | 1.2.23stable | 15/12/2010 |
| 1.2.22stable | MIT license | 1.2.22stable | 13/12/2010 |
| 1.2.21stable | MIT license | 1.2.21stable | 13/12/2010 |
| 1.2.20stable | MIT license | 1.2.20stable | 09/12/2010 |
| 1.2.19stable | MIT license | 1.2.19stable | 03/12/2010 |
| 1.2.16stable | MIT license | 1.2.16stable | 03/12/2010 |
| 1.2.15stable | MIT license | 1.2.15stable | 03/12/2010 |
| 1.2.14stable | MIT license | 1.2.14stable | 02/12/2010 |
| 1.2.13stable | MIT license | 1.2.13stable | 01/12/2010 |
| 1.2.12stable | MIT license | 1.2.12stable | 30/11/2010 |
| 1.2.03stable | MIT license | 1.2.03stable | 29/11/2010 |
| 1.2.02stable | MIT license | 1.2.02stable | 28/11/2010 |
| 1.2.01beta | MIT license | 1.2.01beta | 27/11/2010 |
| 1.1.27stable | MIT license | 1.1.27stable | 25/11/2010 |
| 1.1.26stable | MIT license | 1.1.26stable | 25/11/2010 |
| 1.1.25stable | MIT license | 1.1.25stable | 17/11/2010 |
| 1.1.24stable | MIT license | 1.1.24stable | 01/09/2010 |
| 1.1.23stable | MIT license | 1.1.23stable | 01/09/2010 |
| 1.1.22stable | MIT license | 1.1.22stable | 01/09/2010 |
| 1.1.21stable | MIT license | 1.1.21stable | 30/08/2010 |
| 1.1.20stable | MIT license | 1.1.20stable | 18/08/2010 |
| 1.1.19stable | MIT license | 1.1.19stable | 17/08/2010 |
| 1.1.18stable | MIT license | 1.1.18stable | 17/08/2010 |
| 1.1.17stable | MIT license | 1.1.17stable | 16/08/2010 |
| 1.1.16stable | MIT license | 1.1.16stable | 16/08/2010 |
| 1.1.15stable | MIT license | 1.1.15stable | 01/08/2010 |
| 1.1.14stable | MIT license | 1.1.14stable | 30/07/2010 |
| 1.1.13stable | MIT license | 1.1.13stable | 27/07/2010 |
| 1.1.12stable | MIT license | 1.1.12stable | 27/07/2010 |
| 1.1.11stable | MIT license | 1.1.11stable | 27/07/2010 |
| 1.1.10stable | MIT license | 1.1.10stable | 27/07/2010 |
| 1.0.13stable | MIT license | 1.0.13stable | 27/07/2010 |
| 1.0.12stable | MIT license | 1.0.12stable | 21/07/2010 |
| 1.0.11stable | MIT license | 1.0.11stable | 21/07/2010 |
| 1.0.10stable | MIT license | 1.0.10stable | 21/07/2010 |
| 1.0.9stable | MIT license | 1.0.9stable | 20/07/2010 |
| 1.0.8stable | MIT license | 1.0.8stable | 20/07/2010 |
| Version | License | API | Released |
|---|---|---|---|
| 1.2.26stable | MIT license | 1.2.26stable | 04/03/2011 |
| 1.2.25stable | MIT license | 1.2.25stable | 15/01/2011 |
| 1.2.24stable | MIT license | 1.2.24stable | 16/12/2010 |
| 1.2.23stable | MIT license | 1.2.23stable | 15/12/2010 |
| 1.2.22stable | MIT license | 1.2.22stable | 13/12/2010 |
| 1.2.21stable | MIT license | 1.2.21stable | 13/12/2010 |
| 1.2.20stable | MIT license | 1.2.20stable | 09/12/2010 |
| 1.2.19stable | MIT license | 1.2.19stable | 03/12/2010 |
| 1.2.16stable | MIT license | 1.2.16stable | 03/12/2010 |
| 1.2.15stable | MIT license | 1.2.15stable | 03/12/2010 |
| 1.2.14stable | MIT license | 1.2.14stable | 02/12/2010 |
| 1.2.13stable | MIT license | 1.2.13stable | 01/12/2010 |
| 1.2.12stable | MIT license | 1.2.12stable | 30/11/2010 |
| 1.2.03stable | MIT license | 1.2.03stable | 29/11/2010 |
| 1.2.02stable | MIT license | 1.2.02stable | 28/11/2010 |
| 1.2.01beta | MIT license | 1.2.01beta | 27/11/2010 |
| 1.1.27stable | MIT license | 1.1.27stable | 25/11/2010 |
| 1.1.26stable | MIT license | 1.1.26stable | 25/11/2010 |
| 1.1.25stable | MIT license | 1.1.25stable | 17/11/2010 |
| 1.1.24stable | MIT license | 1.1.24stable | 01/09/2010 |
| 1.1.23stable | MIT license | 1.1.23stable | 01/09/2010 |
| 1.1.22stable | MIT license | 1.1.22stable | 01/09/2010 |
| 1.1.21stable | MIT license | 1.1.21stable | 30/08/2010 |
| 1.1.20stable | MIT license | 1.1.20stable | 18/08/2010 |
| 1.1.19stable | MIT license | 1.1.19stable | 17/08/2010 |
| 1.1.18stable | MIT license | 1.1.18stable | 17/08/2010 |
| 1.1.17stable | MIT license | 1.1.17stable | 16/08/2010 |
| 1.1.16stable | MIT license | 1.1.16stable | 16/08/2010 |
| 1.1.15stable | MIT license | 1.1.15stable | 01/08/2010 |
| 1.1.14stable | MIT license | 1.1.14stable | 30/07/2010 |
| 1.1.13stable | MIT license | 1.1.13stable | 27/07/2010 |
| 1.1.12stable | MIT license | 1.1.12stable | 27/07/2010 |
| 1.1.11stable | MIT license | 1.1.11stable | 27/07/2010 |
| 1.1.10stable | MIT license | 1.1.10stable | 27/07/2010 |
| 1.0.13stable | MIT license | 1.0.13stable | 27/07/2010 |
| 1.0.12stable | MIT license | 1.0.12stable | 21/07/2010 |
| 1.0.11stable | MIT license | 1.0.11stable | 21/07/2010 |
| 1.0.10stable | MIT license | 1.0.10stable | 21/07/2010 |
| 1.0.9stable | MIT license | 1.0.9stable | 20/07/2010 |
| 1.0.8stable | MIT license | 1.0.8stable | 20/07/2010 |
The sfPostgresDoctrinePlugin is a symfony plugin that extends the sfDoctrinePlugin
for Postgres database.
It gives you:
ability to have a real inheritance
schemas menagement
enums and objects menagement
behaviors menagement
generating model for views
Install the plugin (via a package)
symfony plugin:install sfPostgresDoctrinePlugin
Install the plugin (via a Subversion checkout)
svn co http//svn.symfony-project.com/plugins/sfPostgresDoctrinePlugin/trunk plugins/sfPostgresDoctrinePlugin
Activate the plugin in the config/ProjectConfiguration.class.php
class ProjectConfiguration extends sfProjectConfiguration { public function setup() { $this->enablePlugins(array( 'sfDoctrinePlugin', 'sfPostgresDoctrinePlugin', '...' )); } }
You always must tell in tableName attribute fullname of the table, which is schemaName.tableName and set the packege attribute to schemaName.Entities
example:
Vehicle:
tableName: public.vehicles
package: Public.Entities
...
Car:
tableName: car.infos
package: Car.Entities
...
When you generating schema and model you do it the same way like for the sfDoctrinePlugin. The relations, inheritances and enums are building automatically, also when you write behaviors condition in plugins/sfPostgresDoctrinePlugin/config/behaviors.yml the behaviors are binding to the schema and the model.
The naming of the model is automatically genereted. The main format is:
[SchemaName]_[CanonicalizedTableName]_Item
In relations:
[SchemaName]_[CanonicalizedTableName]_Item / to one
[SchemaName]_[CanonicalizedTableName]_Items / to many
In relations when is more then one for the same table the format of the alias is:
[SchemaName]_[CanonicalizedTableName]_Item_For[CanonicalizedColumnName] / to one
[SchemaName]_[CanonicalizedTableName]_Items_For[CanonicalizedColumnName] / to many
When you building db you do it the same way like for the sfDoctrinePlugin.
The creation of the schemas, inheritance, relations and if in plugins/sfPostgresDoctrinePlugin/config/types.yml files are object and enums
is automatical.
in schema.yml file the only information is
inheritance:
extends: #ParentModelName#
example:
Vehicle:
tableName: public.vehicles
package: Public.Entities
...
Bikes:
tableName: public.bikes
package: Public.Entities
inheritance:
extends: Vehicle
...
Car:
tableName: car.infos
package: Car.Entities
inheritence:
extends: Vehicle
...
Truck:
tableName: public.trucks
package: Public.Entities
inheritence:
extends: Car
...
In plugins/sfPostgresDoctrinePlugin/config/types.yml are definition of enums and objects, which are considered in build-sql task:
example:
public.audit: #full name of object (schemaName.objectName
body: > #sql body of the object
creator text,
createtime timestamp with time zone,
updator text,
updatetime timestamp with time zone
tables: all #to which tables check if we generating db
#may be an array with full names of the tables [schemaName1.tableName1, schemaName2.tableName2]
params:
all: audit #columns name condition
#may be an array of columns
schemaName1.tableName1:
- anotheraudit
- mainaudit
schemaName2.tableName2: [audit_a, audit_b]
types.cars: #for enums all above is the same
type: enum #type attribute is a only difference
body: >
'car',
'truck',
'bus'
tables: car.infos
params:
car.infos: vehicle_type
In plugins/sfPostgresDoctrinePlugin/config/behaviors.yml are definition of behaviors, which are considered in building model and schema tasks:
example:
Audit: #name of the behavior
tableName: all #to which tables check if we generating db
#may be an array with full names of the tables
condition:
columns: audit # behavior are binding when table has this column
params:
all:
info: 'some infos for all'
car.infos:
info: 'some infos only for car.infos table
Versioning:
tableName: all
condition:
columns: [current_from, current_to] # behavior are binding when table has this two columns
params:
all:
column_from: current_from
column_to: current_to
Command symfony doctrine:build-views-schema generate schema for views in config/genereted_views.yml
For example next thing to do is copy this file to directory config/doctrine and build model

