const { DataTypes } = require('sequelize');
const { sequelize } = require('../config/database');

const PushToken = sequelize.define('push_tokens', {
  id: { type: DataTypes.INTEGER, primaryKey: true, autoIncrement: true },
  email: { type: DataTypes.STRING(100), allowNull: false },
  token: { type: DataTypes.STRING(255), allowNull: false, unique: true },
  platform: { type: DataTypes.ENUM('ios', 'android'), defaultValue: 'android' },
}, {
  timestamps: true,
  createdAt: 'created_at',
  updatedAt: 'updated_at',
});

module.exports = PushToken;
