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.* .pnp.*
container-data/ container-data

View file

@ -4,8 +4,15 @@ const sequelize = new Sequelize({
dialect: 'sqlite', dialect: 'sqlite',
storage: './data/database.sqlite', storage: './data/database.sqlite',
define: { 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; module.exports = sequelize;

View file

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

View file

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

View file

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

View file

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