123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- const { Sequelize, DataTypes } = require('sequelize');
- const sequelize = new Sequelize({
- dialect: 'sqlite',
- storage: './database/db.sqlite',
- logging: false
- });
- const Containers = sequelize.define('Containers', {
- // Model attributes are defined here
- id: {
- type: DataTypes.INTEGER,
- autoIncrement: true,
- primaryKey: true
- },
- name: {
- type: DataTypes.STRING,
- allowNull: false
- },
- visibility: {
- type: DataTypes.STRING
- // allowNull defaults to true
- },
- size: {
- type: DataTypes.STRING
- // allowNull defaults to true
- },
- group: {
- type: DataTypes.STRING
- // allowNull defaults to true
- },
- start: {
- type: DataTypes.JSON
- // allowNull defaults to true
- },
- stop: {
- type: DataTypes.JSON
- // allowNull defaults to true
- },
- pause: {
- type: DataTypes.JSON
- // allowNull defaults to true
- },
- restart: {
- type: DataTypes.JSON
- // allowNull defaults to true
- },
- remove: {
- type: DataTypes.JSON
- // allowNull defaults to true
- },
- logs: {
- type: DataTypes.JSON
- // allowNull defaults to true
- },
- update: {
- type: DataTypes.JSON
- // allowNull defaults to true
- },
- });
- async function syncModel() {
- await sequelize.sync();
- console.log('Containers model synced');
- }
- syncModel();
- module.exports = Containers;
|