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

Clarify branching strategy in the docs #43

Open
timgabrhel opened this issue Aug 4, 2020 · 7 comments
Open

Clarify branching strategy in the docs #43

timgabrhel opened this issue Aug 4, 2020 · 7 comments

Comments

@timgabrhel
Copy link

Trying to get started exploring the new Piranha Core, but running in to an issue on first time setup. I've done a clone on the full project source, currently on Master.

  • Using the Razor example project.
  1. I ran the default SqlLite template just fine. Was able to explore the site and manager.
  2. Add an appsettings.json and set my connection string.
  3. Point both EF & Identity to my SQL server DB (SQL Azure database)
  4. Run the project
  5. See error referring to a newer LogoId column on the Site.
    image
  6. It appears this is a newer column as found in this migration 20200625060542_AddSiteLogo.cs
    image
  7. I'm not seeing the AddSiteLogo migration in the EFMigrationHistory.
    image

I'm not sure if the migration is failing, or if it's simply not executing. I'm not as familiar with EF migrations so some guidance is appreciated.

@tidyui
Copy link
Member

tidyui commented Aug 4, 2020

Hi there! Have you changed packages to target SQLServer? You need to change both the data package as well as the Identity package! See this page for reference:

https://piranhacms.org/docs/architecture/databases/sql-server

Best regards

@timgabrhel
Copy link
Author

@tidyui Yes, sorry, I forgot to mention. I installed both packages as the necessary types for SQL EF and SQL Identity aren't already present. I did not uninstall any packages, only added the two referenced on this page.

@tidyui
Copy link
Member

tidyui commented Aug 4, 2020

@timgabrhel I actually also missed that you were running on master and not the current packages 😁 Master is our development branch and might not be stable. The SiteLogo field is new for 8.4 and we probably haven’t had time to create the migration for SQLServer yet!

If you’re happy with the 8.3 functionality you can find the latest stable release in the version branch!

Best regards

Håkan

@tidyui tidyui closed this as completed Aug 4, 2020
@tidyui
Copy link
Member

tidyui commented Aug 5, 2020

@filipjansson Can you take a look at this when you get the time. It looks like you have already created the migration for SQLServer but it doesn't appear to be executing correctly.

@timgabrhel
Copy link
Author

@tidyui Might I suggest some guidance of this note, perhaps under this section.
https://github.com/PiranhaCMS/piranha.core#get-the-latest-source-code-and-get-going

@tidyui
Copy link
Member

tidyui commented Aug 6, 2020

Yes good idea! I’ll rename this issue and move it to the documentation repo!

@tidyui tidyui reopened this Aug 6, 2020
@tidyui tidyui changed the title Migrations issue running Razor sample for first time Clarify branching strategy in the docs Aug 6, 2020
@tidyui tidyui transferred this issue from PiranhaCMS/piranha.core Aug 6, 2020
@filipmatsman
Copy link
Contributor

Hi!

I tried to reproduce this behavior but without success.
All the migration run and all the columns is in place.

What I did notice is that your EFMigrationHistory table is missing one migration from the Piranha.AspNetCore.Identity.SQLServer package, the initial migration called 20180516203540_InitialCreate.

My startup:

services.AddPiranha(options =>
{
    options.AddRazorRuntimeCompilation = true;

    options.UseFileStorage(naming: FileStorageNaming.UniqueFolderNames);
    options.UseImageSharp();
    options.UseManager();
    options.UseTinyMCE();
    options.UseMemoryCache();

    options.UseEF<SQLServerDb>(db =>
        db.UseSqlServer("Data source=.\\sqlexpress;initial catalog=piranha;Integrated Security=True;multipleactiveresultsets=true;"));
    options.UseIdentityWithSeed<IdentitySQLServerDb>(db =>
        db.UseSqlServer("Data source=.\\sqlexpress;initial catalog=piranha;Integrated Security=True;multipleactiveresultsets=true;"));

    options.UseSecurity(o =>
    {
        o.UsePermission("Subscriber");
    });
});

BR
Filip

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

No branches or pull requests

3 participants