ezsystems / eztags

GNU General Public License v2.0
40 stars 40 forks source link

postgresql cant have an index with the same name of the table #93

Closed wizhippo closed 9 years ago

gggeek commented 9 years ago

should'nt this go as well in the ini settings? (see how oracle deals with these things)

emodric commented 9 years ago

@gggeek Not sure what you mean?

gggeek commented 9 years ago

See fe. dbschema.ini in ezflow.

It relates to the way ezp is supposed to handle db structure starting from schema files, not just from sql

wizhippo commented 9 years ago

@gggeek I have added one based on your example. This means no change in the db_schema.dba is needed correct?

gggeek commented 9 years ago

Exactly.

I never tested it with postgresql though.

If you have an ezp with postgres, the easy way to check if it works is to go to admin interface => check for updates

wizhippo commented 9 years ago

@gggeek Just ran the upgrade check with this change and there are no issues with eztags. Thanks for the direction.

emodric commented 9 years ago

Sorry, but what's the point of adding dbschema.ini when the same thing can be achieved directly in SQL file with CREATE TABLE statements?

gggeek commented 9 years ago

@emodric this is all legacy and will never get properly finished but the overarching idea is:

As you can see, these features are so nice that we should have stopped providing sql ages ago

ps: if you change the sql but not the dbschema, and you go to ''update check", you will be told that your db is not good

andrerom commented 9 years ago

+1

emodric commented 9 years ago

@gggeek If that is the case, since we already provide SQL files, and dbschema files are not being widely used, I'd rather just update the SQL files.

gggeek commented 9 years ago

Your code, your choice :-)

If you do not plan to keep the dba files up to date, remove them from the repo.

Your tables will break when trying to move data from mysql to postgres using ezsqldumpschema. And users will just be told to drop your tables when checking the 'update check page'. But we all know that no-one ever does any of that, right? :-P

emodric commented 9 years ago

I didn't say to remove dbschema files. They're useful when checking for db changes in admin.

What I wanted to say is to update all mysql files and dbschema file to have the same names for indexes, to keep them in sync.

gggeek commented 9 years ago

Sorry, my bad. Yes, fixing dba+sql for all dbs and not introducing dbschema.ini is recommended, I thought that you were fixing only the postgres variant in the first place for a specific reason.

emodric commented 9 years ago

Yes, this pull request was specific in the first place, but I guess @wizhippo can update it properly to rename all indexes to have idx_ prefix for example in all files.

wizhippo commented 9 years ago

@emodric Is this what you were thinking?

emodric commented 9 years ago

Yep!

I also made a comment to fix the unique index name in pgsql schema. I know the original was wrong, but since you're at it, you can fix that too :)

wizhippo commented 9 years ago

@emodric fixed

emodric commented 9 years ago

Thanks, merging!