pugx / shortid-doctrine Goto Github PK
View Code? Open in Web Editor NEWA Doctrine field type for ShortId
License: MIT License
A Doctrine field type for ShortId
License: MIT License
For instance, Postgres by default does not know this collation and fails with:
SQLSTATE[42704]: Undefined object: 7 ERROR: collation "utf8_bin" for encoding "UTF8" does not exist `.
By default it does accept C.UTF-8
or... default
.
By hardcoding this value, you limit use cases to MySQL with imposed collation and break Doctrine's @Column
collation
support.
Specifing collation
in @Column
renders invalid SQL
/**
* @ORM\Column(type="shortid", options={"collation": "C.UTF-8"})
*/
renders SQL like that:
CHAR(7) COLLATE "utf8_bin" NOT NULL COLLATE "C.UTF-8"
As a short-term workaround, it's possible to prepend migration with:
CREATE COLLATION IF NOT EXISTS utf8_bin FROM "C.UTF-8";
But this solution breaks migrations atomicity.
Hi,
I read through the code and now I am not sure, if possible ID collisions are detected or actively avoided? I found this answer on stackoverflow suggesting a method how to actively avoid collisions with existing entities. Now I'm wondering, if Doctine itself handles such collisions internally?
Collisions are very rare, but there is a chance rising with every extisting entity, so checking the generated shortid looks like a good idea.
Any ideas on this?
Add a generator to use with GeneratedValue
option
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.