finish taller5
This commit is contained in:
10
taller5/backend/models/auto.js
Normal file
10
taller5/backend/models/auto.js
Normal file
@@ -0,0 +1,10 @@
|
||||
'use strict'
|
||||
const mongoose = require('mongoose');
|
||||
const Schema = mongoose.Schema;
|
||||
const AutoSchema = Schema({
|
||||
patente: String,
|
||||
anio: Number,
|
||||
marca: { type: Schema.ObjectId, ref: "marca" }
|
||||
});
|
||||
|
||||
module.exports = mongoose.model('auto', AutoSchema);
|
8
taller5/backend/models/marca.js
Normal file
8
taller5/backend/models/marca.js
Normal file
@@ -0,0 +1,8 @@
|
||||
'use strict'
|
||||
const mongoose = require('mongoose');
|
||||
const Schema = mongoose.Schema;
|
||||
const MarcaSchema = Schema({
|
||||
descripcion: String
|
||||
});
|
||||
|
||||
module.exports = mongoose.model('marca', MarcaSchema);
|
Reference in New Issue
Block a user