Git Product home page Git Product logo

doctrine1's People

Contributors

beberlei avatar dominics avatar eabay avatar estahn avatar guilhermeblanco avatar jagalan avatar johnkary avatar jwage avatar klaussilveira avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

doctrine1's Issues

Doctrine CLI

The CLI entry file seems to be in tools/sandbox/doctrine. Why in 'sandbox/'?
And how can I change the base path?
I actually want to use the project folder (above 'vendor/') as the base path.

build-schema problem generate unrelated field in table

Hi,

I have one issue on build-schema on Oracle database.

I have one database and already configured on database.yml.

Current situation, when doctrine execute this query -

SELECT tc.column_name, data_type,
CASE WHEN data_type = 'NUMBER' THEN data_precision ELSE data_length END AS data_length,
nullable, data_default, data_scale, data_precision, pk.primary
FROM all_tab_columns tc
LEFT JOIN (
select 'primary' primary, cc.table_name, cc.column_name from all_constraints cons
join all_cons_columns cc on cons.constraint_name = cc.constraint_name
where cons.constraint_type = 'P'
) pk ON pk.column_name = tc.column_name and pk.table_name = tc.table_name
WHERE tc.table_name = :tableName ORDER BY column_id

there's another schema had the same table name with my current database connection in database.yml. Doctrine generate all fields that it found from above query. After generate my doctrine model & form and execute a query to list all the data in the table, it's throw an exception ORA-00904, unexisting column in database.

It's there any solution that I can set the table owner so above query will have additional condition like this:

tc.owner = :schemaowner.

TQ.

Doctrine fix for PHP 7.0.0

Hi team,
Here is some correction for PHP 7.0.0:

Doctrine/Collection.php - line 463

- $record->$relation['alias'] = $this->reference;
+ $record->{$relation['alias']} = $this->reference;

Doctrine/Query/Abstract.php - line 1122

- $record->$callback['callback']($event);
- $table->getRecordListener()->$callback['callback']($event);
+ $record->{$callback['callback']($event)};
+ $table->getRecordListener()->{$callback['callback']($event)};

Doctrine 1.2 API documentation

I can't seem to find the API documentation anywhere. Could you please host it somewhere or point me there, if it's online.

Wrong package

Code from http://github.com/doctrine/doctrine1/blob/master/lib/Doctrine/Import/Pgsql.php

'listTableColumns' => "SELECT
ordinal_position as attnum,
column_name as field,
udt_name as type,
data_type as complete_type,
is_nullable as isnotnull,
column_default as default,
(
SELECT 't'
FROM pg_index, pg_attribute a, pg_class c, pg_type t
WHERE c.relname = table_name AND a.attname = column_name
AND a.attnum > 0 AND a.attrelid = c.oid AND a.atttypid = t.oid
AND c.oid = pg_index.indrelid AND a.attnum = ANY (pg_index.indkey)
AND pg_index.indisprimary = 't'
) as pri,
character_maximum_length as length
FROM information_schema.COLUMNS
WHERE table_name = %s
ORDER BY ordinal_position",

Code from package: http://www.doctrine-project.org/downloads/Doctrine-1.2.3.tgz

'listTableColumns'     => "SELECT
                                                     ordinal_position as attnum,
                                                     column_name as field,
                                                     udt_name as type,
                                                     data_type as complete_type,
                                                     t.typtype AS typtype,
                                                     is_nullable as isnotnull,
                                                     column_default as default,
                                                     (
                                                       SELECT 't'
                                                         FROM pg_index, pg_attribute a, pg_class c, pg_type t
                                                         WHERE c.relname = table_name AND a.attname = column_name
                                                         AND a.attnum > 0 AND a.attrelid = c.oid AND a.atttypid = t.oid
                                                         AND c.oid = pg_index.indrelid AND a.attnum = ANY (pg_index.indkey)
                                                         AND pg_index.indisprimary = 't'
                                                         AND format_type(a.atttypid, a.atttypmod) NOT LIKE 'information_schema%%'
                                                     ) as pri,
                                                     character_maximum_length as length
                                                   FROM information_schema.COLUMNS
                                                   WHERE table_name = %s
                                                   ORDER BY ordinal_position",

Code from the package when generating model returns an error:

SQLSTATE[42P01]: Undefined table: 7 ERROR:  missing FROM-clause entry for table "t"
LINE 6: ... t.typtype ...^. Failing Query: "
SELECT ordinal_position as attnum, column_name as field, udt_name as type,
data_type as complete_type, t.typtype AS typtype, is_nullable as isnotnull, column_default as default,
(
  SELECT 't'
  FROM pg_index, pg_attribute a, pg_class c, pg_type t
  WHERE c.relname = table_name AND a.attname = column_name
  AND a.attnum > 0 AND a.attrelid = c.oid AND a.atttypid = t.oid
  AND c.oid = pg_index.indrelid AND a.attnum = ANY (pg_index.indkey)
  AND pg_index.indisprimary = 't'
  AND format_type(a.atttypid, a.atttypmod) NOT LIKE 'information_schema%'
) as pri, character_maximum_length as length
FROM information_schema.COLUMNS
WHERE table_name = 'flashinfo'
ORDER BY ordinal_position"

autoincrement

Why only integer columns can have autoincrement?

I have column, which type is 'smallint' & I want to set it to be autoincrement. How can I do that?

Doctrine_Connection::createQuery() can use wrong connection

According to the docs, createQuery() method creates a new Doctrine_Query object that operates on connection object the method was executed against. This is not true, if this connection is not a current connection.

Consider the following example:

$conn1 = Doctrine_Manager::connection($pdo);
$conn2 = Doctrine_Manager::connection($pdo);
// here Doctrine_Manager::getCurrentConnection() === $conn2

$query = $conn1->createQuery();
// $query->getConnection() returns $conn2 instead of $conn1

To fix this add $this as the first parameter to Doctrine_Query::create() in createQuery() method in Doctrine/Connection.php file.

Several test cases using CRLF line endings

Hi there. I'm finding several test cases that are using CRLF line endings, instead of unix LF line endings as it seems the rest of the codebase uses.

The test case files are as follows:

  • tests/Ticket/2158TestCase.php
  • tests/Ticket/2251TestCase.php
  • tests/Ticket/2334TestCase.php

This is causing my pull&merge in git to require manual intervention (as I force it to use LF), so I would appreciate it if this could be cleaned up if it isn't that much of a bother. :)

Using ->limit() in conjunction with many-to-many with mysql generates wrong SQL

Using ->limit() in conjunction with many-to-many relationships with mysql leads to strange SQL generated. The condition id IS NULL is added in such case which is not correct at all.

Here's example schema

User:
  columns:
    username: { type: string(255) }
  relations:
    Operators:
      foreignAlias: Users
      class:        Operator
      refClass:     OperatorUser

Operator:
  columns:
    username: { type: string(255) }
    type:     { type: integer }


OperatorUser:
  columns:
    user_id:      { type: integer }
    operator_id:  { type: integer }
  relations:
    Operator:
      foreignAlias: OperatorUser
    User:
      foreignAlias: OperatorUser

And here's query which generates wrong SQL

<?php
Doctrine_Core::getTable('User')
  ->createQuery('User')
  ->leftJoin('User.Operators Operator')
  ->addWhere('Operator.type = ?', 1)
  ->limit(10)
  ->offset(0)
  ->execute()
;

(alternatively you can play in sandbox here https://github.com/eafonichev/doctrine-issue )

Expected SQL generated:

SELECT u.id AS u__id, u.username AS u__username, o.id AS o__id, o.username AS o__username, o.type AS o__type
FROM user u
LEFT JOIN operator_user o2  ON (u.id = o2.user_id)
LEFT JOIN operator o        ON o.id = o2.operator_id
WHERE (o.type = '1')
LIMIT 10

Actual SQL generated:

SELECT u.id AS u__id, u.username AS u__username, o.id AS o__id, o.username AS o__username, o.type AS o__type
FROM user u
LEFT JOIN operator_user o2  ON (u.id = o2.user_id)
LEFT JOIN operator o        ON o.id = o2.operator_id
WHERE
  u.id IS NULL # is not expected
  AND (o.type = '1')
# there's no LIMIT clause

Seems like here's code which causes the bug https://github.com/doctrine/doctrine1/blob/master/lib/Doctrine/Query.php#L1307

MySQL 5.7+ error on DISTINCT subquery execution

If someone else also hit the problem with MySQL 5.7+

Expression #1 of ORDER BY clause is not in SELECT list,

There is a easy fix by adding 'mysql' driver name (last OR below, originally is missing) to the Query.php file at line 1417 (as now MySQL also require order by fields to be preserved in select clause):
// pgsql & oracle need the order by fields to be preserved in select clause if ($driverName == 'pgsql' || $driverName == 'oracle' || $driverName == 'oci' || $driverName == 'mssql' || $driverName == 'odbc' || $driverName = 'mysql') {

Add "bigint" type to the Doctrine_Formatter::quote(...)

Index: Formatter.php
===================================================================
--- Formatter.php   (revision 2)
+++ Formatter.php   (working copy)
@@ -171,6 +171,7 @@
         case 'bool':
         case 'decimal':
         case 'int':
+        case 'bigint':
             return $input;
         case 'array':
         case 'object':

And will be nice create default case for it.

Documentation flaw + feature request

Documentation flaw: Doctrine_Connection_UnitOfWork#saveGraph
line#47 @return void (change to @return boolean)

Feature Request: Doctrine_Record#save
line#1718 $conn->unitOfWork->saveGraph($this); (change to return $conn->unitOfWork->saveGraph($this); )

Now the return from UnitOfWork#saveGraph can actually do something and let me know if me record was actually saved.

Packagist tags are missing

For some of our legacy projects we had a composer dependency to doctrine/doctrine1, since a few days all tags seem to be missing from packagist, except dev-master.
https://packagist.org/packages/doctrine/doctrine1

This repository does still seem to have tags, but I could not find any information about why the tags are suddenly missing on packagist. Is it possible to recreate some stable tags or provide some more information about the tags being deleted ?

Doctrine 1 JIRA not migrated

It's a shame that Doctrine 1 JIRA issues have not beed migrated to github. Some people are still using Doctrine 1 and have no chance to migrate to 2.
e.g. I wanted to get some info about the bug I reported several years ago, as I encoutered it again: http://webcache.googleusercontent.com/search?q=cache:KpYEn6DJfp8J:www.doctrine-project.org/jira/browse/DC-313%3Fpage%3Dcom.atlassian.jira.plugin.system.issuetabpanels:changehistory-tabpanel+&cd=1&hl=pl&ct=clnk&gl=pl

It's only a matter of short time when that will be gone for good, also from google.

Doctrine 1.1.6

Hi there,
I need original source files of Doctrine 1.1.6, is there any possibility to get those?
I've searched through web, but unfortunatelly I found nothing. The problem is that, in our project repository we have modified version of Doctrine 1.1.6, and we need to upgrade. First we should check if there are any crucial changes. Saddly, changes where made before the source files where added to repository, so we don't have a clue, how it loooked like before. Thank you for help.

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.