Jump to content
  • 0
Sign in to follow this  
Escanor

Migration Database

Question

Hi,

 

I try to make a multi-character system. For that I create a class Characters that is declared in the Player Class.

When i try to migrate the database i got this error message :

 

fd32e508d9adbd0feee5fdca9f2eb9fb.png

 

My Character's class :

 

a548441b9e66ec3ed21602b5a6b5c199.png

 

My Player's class :

 

e89e2dfc23e782f26a8d1205826bdf23.png

 

Edit: The player unlock various characters throught the game which offers him the possibility of switching between different characters at any giving time to try new playstyles.

 

Thanks for your help

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0

If you open the migration files that EF generated and remove the addition of the foreign key it might work. Sqlite is weird in what can and cannot be added once tables exist. 

Share this post


Link to post
Share on other sites
  • 0

There's already an existing system for having multiple characters per account though. Why not use the existing system for it and make your desired adjustments rather than messing with new database elements?

Share this post


Link to post
Share on other sites
  • 0
On 11/10/2020 at 5:08 PM, jcsnider said:

If you open the migration files that EF generated and remove the addition of the foreign key it might work. Sqlite is weird in what can and cannot be added once tables exist. 

 

The migrations works after deleting the foreign key but when i create a new account here is what happen :

 

192d66a04f12b0fdeea7c8adf1dccb26.png

 

On 11/10/2020 at 5:23 PM, Cheshire said:

There's already an existing system for having multiple characters per account though. Why not use the existing system for it and make your desired adjustments rather than messing with new database elements?

 

Because characters have to share the same informations apart level, stats, vitals...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...