Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add seed data for the very first time installation #79

Closed
pournasserian opened this issue Oct 28, 2023 · 0 comments · Fixed by #116
Closed

Add seed data for the very first time installation #79

pournasserian opened this issue Oct 28, 2023 · 0 comments · Fixed by #116
Labels
enhancement New feature or request
Milestone

Comments

@pournasserian
Copy link
Contributor

When a developer clones the project, only connection string (or other few configs) should be set.

Then by running the application, initial seed data should be inserted to the DB:

  • Site for localhost
  • User
  • Role
  • A few Pages (About Us, Contact Us, etc.)

The above objects should be read from json files which exist in the project's source files (like SeedData/user.json).
It is not preferred to hard-code the initial/default objects' properties in the C# code.
So, in the first request we should check if any Site records exists or not.
If not, it should read the site.json and insert to DB, then user.json, role.json, etc.

Here is a draft hard-coded seed data implementation:
https://github.com/ubeac/ubeac-cms/blob/main/uBeacCMS.Web/SeedData.cs

And the usage in program.cs:
app.Services.SeedDefaultData();

@pournasserian pournasserian added the enhancement New feature or request label Oct 28, 2023
@pournasserian pournasserian added this to the MVP milestone Oct 28, 2023
@pournasserian pournasserian linked a pull request Nov 5, 2023 that will close this issue
@github-project-automation github-project-automation bot moved this to Done in FluentCMS Nov 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant