Skip to content

Dynamic attibute for related primary key - #243

Closed
fogelito wants to merge 10 commits into
mainfrom
dynamic-primary-key
Closed

Dynamic attibute for related primary key#243
fogelito wants to merge 10 commits into
mainfrom
dynamic-primary-key

Conversation

@fogelito

@fogelitofogelito commented Mar 6, 2023

Copy link
Copy Markdown
Contributor

Database::VAR_ID
Since some adapters primary key is a string and some is an int , we need a dynamic ID field per adapter

return "VARCHAR({$size})";

case Database::VAR_ID:
return 'INT UNSIGNED'; // Same as Primary Key Sqlite does not allow INT(11)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make this INT(11) and override for SQLite?

Comment threadsrc/Database/Database.php Outdated
break;

case Database::VAR_ID:
$validator = new Text(24, min: 0); // Mongo Id length

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this can be 36 for non-mongo adapters 🤔 how can we handle both?

@fogelito

fogelito commented Aug 1, 2023

Copy link
Copy Markdown
ContributorAuthor

Added an Asana task in the backlog
Or do we want to to merge this ? :)

@fogelitofogelito closed this Aug 1, 2023
@fogelitofogelito reopened this Aug 1, 2023
@fogelito
fogelito requested a review from abnegateAugust 1, 2023 10:38
Co-authored-by: Jake Barnby <jakeb994@gmail.com>
@fogelitofogelito mentioned this pull request Jul 14, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@fogelito@abnegate