stuffy stuff

This commit is contained in:
counterweight 2025-02-08 15:57:54 +01:00
parent faee3ca0ea
commit 2c1c1bd774
Signed by: counterweight
GPG key ID: 883EDBAA726BD96C
6 changed files with 12 additions and 12 deletions

2
.gitignore vendored
View file

@ -136,4 +136,4 @@ dist
.pnp.*
container-data/
container-data

View file

@ -4,8 +4,15 @@ const sequelize = new Sequelize({
dialect: 'sqlite',
storage: './data/database.sqlite',
define: {
timestamps: false
timestamps: false,
freezeTableName: true
},
});
sequelize.sync().then(() => {
console.log('Database synced');
}).catch(err => {
console.error('Error syncing the database:', err);
});
module.exports = sequelize;

View file

@ -3,6 +3,7 @@ version: '3'
services:
express:
build: .
user: "${UID:-1000}:${GID:-1000}"
ports:
- "3000:3000"
volumes:

View file

@ -9,14 +9,6 @@ const SessionNpubbed = require('./models/SessionNpubbed');
const app = express();
const port = 3000;
sequelize.sync()
.then(() => {
console.log('Database synced');
})
.catch(err => {
console.error('Error syncing the database:', err);
});
app.use(cookieParser());
app.use(express.json());

View file

@ -11,7 +11,6 @@ const SessionNpubbed = sequelize.define('SessionNpubbed', {
sessionUuid: {
type: DataTypes.UUID,
allowNull: false,
unique: true,
},
npub: {
type: DataTypes.STRING,

View file

@ -15,9 +15,10 @@
"start": "node index.js",
"start:containers": "docker compose up -d --build",
"stop:containers": "docker compose down",
"purge-dev-data": "rm -rf ./container-data",
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC"
}
}