Mise a jour des models

Signed-off-by: Avior <florian.bouillon@delta-wings.net>
This commit is contained in:
Florian Bouillon 2020-04-29 14:32:32 +02:00
parent 5e1987c6ba
commit e66ff18fda
No known key found for this signature in database
GPG Key ID: B143FF27EF555D16
2 changed files with 4 additions and 13 deletions

View File

@ -1,10 +1,5 @@
import Sequelize from 'sequelize'
import { connexion } from '../libs/util'
/*
name
coordx
coordy
*/
class Coin extends Sequelize.Model {}
Coin.init({

View File

@ -1,13 +1,6 @@
import Sequelize from 'sequelize'
import { connexion } from '../libs/util'
import Coin from './Coin'
/*
pseudo
path
location (one-to-many Coin)
*/
class Photo extends Sequelize.Model {}
Photo.init({
@ -19,10 +12,13 @@ Photo.init({
type: Sequelize.STRING,
allowNull: false
},
coinId: {
type: Sequelize.BIGINT,
allowNull: false
}
}, {
sequelize: connexion,
modelName: 'photo'
})
Photo.hasOne(Coin)
export default Photo