wiz/controller/storage.js

36 lines
809 B
JavaScript
Raw Permalink Normal View History

2019-02-12 16:25:14 +01:00
const db_settings = require('../config/db_settings.json');
console.log(global.dir+'/'+db_settings.settings[3].storage);
const Sequelize = require('sequelize');
const sequelize = new Sequelize('', '', '', {
dialect: 'sqlite',
storage: global.dir+'/'+db_settings.settings[3].storage
});
const Files = sequelize.define('files', {
id: {
type: Sequelize.INTEGER,
primaryKey: true,
autoIncrement: true,
},
title: Sequelize.STRING,
filename: Sequelize.STRING
});
const Tags = sequelize.define('tags',{
id:{
type: Sequelize.INTEGER,
primaryKey:true,
autoIncrement: true
},
tag_name:Sequelize.STRING
})
const Files_Tags = sequelize.define('files_tags',{
file:Sequelize.INTEGER,
tag:Sequelize.INTEGER
})
sequelize.sync()