Explorar el Código

Initial commit

sbkwgh hace 8 años
padre
commit
ade4ba95c4
Se han modificado 2 ficheros con 14 adiciones y 0 borrados
  1. 14 0
      models/thread.js
  2. 0 0
      routes/thread.js

+ 14 - 0
models/thread.js

@@ -0,0 +1,14 @@
+module.exports = (sequelize, DataTypes) => {
+	let Thread = sequelize.define('Thread', {
+		title: DataTypes.STRING
+	}, {
+		classMethods: {
+			associate (models) {
+				Thread.belongsTo(models.User)
+				Thread.hasMany(models.Post)
+			}
+		}
+	})
+
+	return Thread
+}

+ 0 - 0
routes/thread.js