mirror of
https://github.com/opensolutions/ViMbAdmin.git
synced 2026-04-26 00:36:00 +03:00
[GH-ISSUE #23] Table creation fails on PostgreSQL #21
Labels
No labels
bug
feature
feature
improvement
improvement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ViMbAdmin-opensolutions#21
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @nrosier on GitHub (Aug 28, 2012).
Original GitHub issue: https://github.com/opensolutions/ViMbAdmin/issues/23
Hi,
I'm trying to install ViMbAdmin with PostgreSQL but the table-creation fails:
./doctrine-cli.php create-tables
SQLSTATE[25P02]: In failed sql transaction: 7 ERROR: current transaction is aborted, commands ignored until end of transaction block. Failing Query: "ALTER TABLE alias ADD CONSTRAINT alias_domain_domain_domain FOREIGN KEY (domain) REFERENCES domain(domain) NOT DEFERRABLE INITIALLY IMMEDIATE". Failing Query: ALTER TABLE alias ADD CONSTRAINT alias_domain_domain_domain FOREIGN KEY (domain) REFERENCES domain(domain) NOT DEFERRABLE INITIALLY IMMEDIATE
Has anyone tested this before?
N.
@barryo commented on GitHub (Oct 10, 2012):
I haven't come across this before but we will push this to the next milestone and test with Doctrine 2.x
@martintama commented on GitHub (Jun 6, 2013):
Any updates on this? I'm installing ViMbAdmin from the master branch, and the database initialization fails with the same error.
OS: Debian 7 Wheezy.
Database: PostgreSQL 9.1
Any help would be appreciated.
@morfran commented on GitHub (Jul 7, 2013):
Since nobody seems to be terribly interested, you can move on from here by creating the database from the output of this command:
./doctrine-cli.php generate-sql
I also put a path into library/Doctrine/Doctrine/Task/GenerateSql.php so that I could pick up the output; In the execute function in that file:
You should then get the output for building your tables in the file /tmp/vimbadmin.sql
I ran it in psql and it worked, so I'm not sure what the issue is. I had to rename the domain index (to domain_idx) due to the table with the same name.
Output here:
http://pastebin.com/txKvfC7q
@dxtr commented on GitHub (Sep 7, 2013):
Yep. I just hit this issue too with the current (as in from today) master branch
@morfran's recommendations worked so far at least
@rootwyrm commented on GitHub (Oct 8, 2013):
Yep, hit it today myself.
doctrine-cli.php is spitting out a false error. The actual problem:
liam@scemail [32514] ERROR: relation "domain" already exists
Well, the problem is obvious - it's trying to create an INDEX with the same name as the table AND column. Obviously a no-no. What I can't figure out is why Doctrine is trying to create an index there - IOW, I think it's a Doctrine problem. What's more annoying is that adding explicit indexes in the YAML definition also doesn't fix it, even though it should.
Also worth noting, this is the only INDEX Doctrine attempts to create.
@barryo commented on GitHub (Oct 9, 2013):
Nice work @rootwyrm - the good news is ViMbAdmin3 uses Doctrine2 and so should be immune from this issue.
@rootwyrm commented on GitHub (Oct 9, 2013):
One can hope; I haven't touched Doctrine2 so no idea. Obviously the optimal solution would be to create a proper set of indexes in the YAML, but I'm a PostgreSQL guy. No idea how they'd behave in MySQL, MariaDB or Percona. :(
@barryo commented on GitHub (Feb 15, 2014):
V3 is now released and using Doctrine2.