Skip to content

Conversation

@Angeluz-07
Copy link
Contributor

No description provided.

Comment on lines 25 to 26
__tablename__ = 'project'
id = db.Column(db.Integer, primary_key=True)
id = db.Column(db.String, primary_key=True)
Copy link
Contributor

Choose a reason for hiding this comment

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

Whenever you see a String that is related to a UUID, you should probably set a max number of characters, like 64 maybe.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also SQL Alchemy has multiple ways of generating UUID content and you need to do it for the attribute id.

Copy link
Contributor

Choose a reason for hiding this comment

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

So that you are sure that such UUID works, you should probably change a bit the SQL Repository tests so that the model uses a UUID as primary key and verify that such id is actually being generated.

description='Either identifier or locator',
example=faker.words(
1,
['http://example.com/mypage.html', '/some/page.html']
Copy link
Contributor

Choose a reason for hiding this comment

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

I would specify something like a Jira ticket, e.g. TT-124 or a the URL of a Github issue, e.g. #51. Something like that, so this makes sense to the user.

Copy link
Contributor

@EliuX EliuX left a comment

Choose a reason for hiding this comment

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

Nice work, there are a few comments

example='anonymous',
),
}
"""
Copy link
Contributor

Choose a reason for hiding this comment

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

Do not leave commented content

"description": fake.paragraph(nb_sentences=2),
"start_date": fake.iso8601(end_datetime=None),
"end_date": fake.iso8601(end_datetime=None),
"owner_id": fake.uuid4(),
Copy link
Contributor

Choose a reason for hiding this comment

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

The model in LucidCharts has this field as owner only. @EliuX should we change the PR or update the LucidCharts diagram?

Copy link
Contributor

Choose a reason for hiding this comment

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

Sure

Copy link
Contributor

@EliuX EliuX left a comment

Choose a reason for hiding this comment

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

Just correct this tiny detail in all the missing fields and we should be ready to go

name = db.Column(db.String(50), unique=True, nullable=False)
description = db.Column(db.String(250), unique=False, nullable=False)
deleted = db.Column(db.String, default=None)
tenant_id = db.Column(db.String, nullable=False)
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's change all id fields that are supposed to be UUID to the right type. The use of String was actually a workaround.

@Angeluz-07 Angeluz-07 merged commit 51091f5 into master Apr 3, 2020
@EliuX EliuX deleted the feature/update-models-to-meet-new-design#64 branch April 3, 2020 22:02
Sign up for free to 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.

4 participants