ergo / ziggurat_foundations

Framework agnostic set of sqlalchemy classes that make building applications that require permissions an easy task.
BSD 3-Clause "New" or "Revised" License
71 stars 22 forks source link

decrease identifiers #51

Closed sahama closed 7 years ago

sahama commented 7 years ago

In oracleDB names must be from 1 to 30 bytes long. may you decrease names to be less than 30? if you do this it is possible to use ziggurat_foundations with oracleDB.

ergo commented 7 years ago

Hi, can you be more specific which identifiers/fields you have in mind?

I think char field can be 2000 bytes or longer according to oracle documentation.

sahama commented 7 years ago

Hi, at first table name alembic_ziggurat_foundations_version with length 36. after i rename it to some thing like alembic_zigg_version. other errors happened. next i see this:

sqlalchemy.exc.DatabaseError: (cx_Oracle.DatabaseError) ORA-00972: identifier is too long
 [SQL: '\nCREATE TABLE groups_permissions (\n\tgroup_name NVARCHAR2(50) NOT NULL, \n\tperm_name NVARCHAR2(30) NOT NULL, \n\tCONSTRAINT pk_groups_permissions PRIMARY KEY (group_name, perm_name), \n\tCONSTRAINT fk_groups_permissions_group_name_groups FOREIGN KEY(group_name) REFERENCES groups (group_name) ON DELETE CASCADE\n)\n\n']

that refer to fk_groups_permissions_group_name_groups as column name is too long. Thanks for taking the time to read this.

ergo commented 7 years ago

The project has many long index and table names - I think at this point there is no reasonable way to fix this without breaking backwards compatibility. Is there a config option for oracle that you can use to make table/index names longer? Alternatively I would suggest using postgresql as your database option.

sahama commented 7 years ago

I searched but i don found any solution to increase it in oracle. This is may be only solution that i use alternative DBMS. Thanks

ergo commented 7 years ago

Yes, I think at this point there is little I can do without bad breakage. I suggest you go with postgresql - since optional nested tree module currently supports only this RDBMS. I'll close the issue for now.