Jump to content
  • 0

Migration Database


Escanor

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

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 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...

Link to comment
Share on other sites

  • 0

Honestly you haven't given us enough information about the structure of the entities or the current state of the DB structure for us to help.

This isn't like an error code that you tell us a number and we tell you the solution, solving it involves awareness of the code you wrote and the current state of data.

Link to comment
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
×
×
  • Create New...