feat: inicializar repositorio oficial do clube67.com
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import { db } from '../src/config/database';
|
||||
|
||||
async function run() {
|
||||
try {
|
||||
const benefits = await db('benefits')
|
||||
.select('id', 'title', 'public_title', 'public_description', 'public_hide_values')
|
||||
.limit(5)
|
||||
.orderBy('updated_at', 'desc');
|
||||
|
||||
console.log('Recent Benefits Data:', JSON.stringify(benefits, null, 2));
|
||||
} catch (error) {
|
||||
console.error('Error:', error);
|
||||
} finally {
|
||||
await db.destroy();
|
||||
}
|
||||
}
|
||||
|
||||
run();
|
||||
@@ -0,0 +1,26 @@
|
||||
import { db } from '../src/config/database';
|
||||
|
||||
async function run() {
|
||||
try {
|
||||
const id = 1; // Assuming ID 1 exists
|
||||
const payload = {
|
||||
public_title: "Teste de Título Público",
|
||||
public_description: "Descrição pública de teste via script",
|
||||
public_hide_values: true
|
||||
};
|
||||
|
||||
console.log(`Updating benefit ${id} with:`, payload);
|
||||
|
||||
await db('benefits').where({ id }).update(payload);
|
||||
|
||||
const updated = await db('benefits').where({ id }).first();
|
||||
console.log('Updated Benefit:', JSON.stringify(updated, null, 2));
|
||||
|
||||
} catch (error) {
|
||||
console.error('Error:', error);
|
||||
} finally {
|
||||
await db.destroy();
|
||||
}
|
||||
}
|
||||
|
||||
run();
|
||||
Reference in New Issue
Block a user