Skip to content

Fro 17 setup des bases de donnees#7

Merged
pierrick-fonquerne merged 8 commits intodevelopfrom
FRO-17-Setup-des-bases-de-donnees
Dec 9, 2025
Merged

Fro 17 setup des bases de donnees#7
pierrick-fonquerne merged 8 commits intodevelopfrom
FRO-17-Setup-des-bases-de-donnees

Conversation

@pierrick-fonquerne
Copy link
Copy Markdown
Owner

No description provided.

- Create tables: role, user, character, article, character_article, comment
- Add indexes for performance optimization
- Seed roles, test users, articles and sample characters
- Gender: Male, Female
- ArticleType: Clothing, Armor, Weapon, Accessory
- CommentStatus: Pending, Approved
- ActivityAction: 12 actions for MongoDB activity logs
- Role, User, Character, Article, CharacterArticle, Comment (PostgreSQL)
- ActivityLog (MongoDB)
- Add MongoDB.Bson package for ActivityLog serialization
…ntion

- SnakeCaseNamingConvention for automatic PascalCase to snake_case mapping
- DbContext with 6 DbSets and Fluent API configuration
- Enums stored as strings for SQL readability
- MongoDB context with ActivityLogs collection
- Uses primary constructor (C# 12)
- Add connection strings placeholders in appsettings.json
- Add DependencyInjection.cs with AddInfrastructure extension method
- Add InMemory EF Core package for unit tests
- Add 5 unit tests for FantasyRealmDbContext
@vercel
Copy link
Copy Markdown

vercel bot commented Dec 9, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
fantasyrealm-character-manager Ready Ready Preview Comment Dec 9, 2025 11:00am

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +76 to +79
entity.Property(e => e.Gender)
.HasConversion<string>()
.HasMaxLength(20)
.IsRequired();
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Align enum conversions with DB check constraints

EF Core maps Gender, ArticleType, and CommentStatus to strings via HasConversion<string>(), which writes PascalCase values such as "Male", "Weapon", and "Pending". The SQL schema introduced in the same commit (database/sql/001_create_tables.sql lines 39, 63, 90) enforces lowercase-only values through CHECK constraints ('male', 'armor', 'pending'), so any SaveChanges against a database created from that script will fail when inserting characters, articles, or comments due to constraint violations. The enum conversion or the SQL constraints need to use the same casing.

Useful? React with 👍 / 👎.

@pierrick-fonquerne pierrick-fonquerne merged commit 57ddfa7 into develop Dec 9, 2025
4 checks passed
@pierrick-fonquerne pierrick-fonquerne deleted the FRO-17-Setup-des-bases-de-donnees branch December 9, 2025 13:04
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.

1 participant