var db = require('../config');
var Link = require('./link.js')

var Click = db.Model.extend({
  tableName: 'clicks',
  hasTimestamps: true,
  link: function() {
    return this.belongsTo(Link, 'link_id');
  }
});

module.exports = Click;

var db = require('../config');
var User = require('./user.js')
var Event = require('./event.js')

var Invite = db.Model.extend({
  tableName: 'invites',
  hasTimestamps: true,
  user: function() {
    return this.hasOne(User, 'user_id');
  },
  event: function() {
    return this.hasOne(Event, 'event_id');
  }
});

module.exports = Invite;

Complete basic models and collections for users, events and invites