Тестовый коммит после удаления husky
This commit is contained in:
@@ -5,20 +5,20 @@ dotenv.config();
|
||||
|
||||
const pool = new Pool({
|
||||
connectionString: process.env.DATABASE_URL,
|
||||
ssl: process.env.NODE_ENV === 'production' ? { rejectUnauthorized: false } : false
|
||||
ssl: process.env.NODE_ENV === 'production' ? { rejectUnauthorized: false } : false,
|
||||
});
|
||||
|
||||
async function initDb() {
|
||||
try {
|
||||
console.log('Инициализация базы данных...');
|
||||
|
||||
|
||||
// Добавляем тестового пользователя
|
||||
await pool.query(`
|
||||
INSERT INTO users (address, is_admin)
|
||||
VALUES ('0xf45aa4917b3775ba37f48aeb3dc1a943561e9e0b', TRUE)
|
||||
ON CONFLICT (address) DO NOTHING
|
||||
`);
|
||||
|
||||
|
||||
// Добавляем тестовую доску
|
||||
await pool.query(`
|
||||
INSERT INTO kanban_boards (title, description, owner_id, is_public)
|
||||
@@ -30,17 +30,18 @@ async function initDb() {
|
||||
)
|
||||
ON CONFLICT DO NOTHING
|
||||
`);
|
||||
|
||||
|
||||
// Получаем ID доски
|
||||
const boardResult = await pool.query(`
|
||||
SELECT id FROM kanban_boards WHERE title = 'Тестовая доска' LIMIT 1
|
||||
`);
|
||||
|
||||
|
||||
if (boardResult.rows.length > 0) {
|
||||
const boardId = boardResult.rows[0].id;
|
||||
|
||||
|
||||
// Добавляем тестовые колонки
|
||||
await pool.query(`
|
||||
await pool.query(
|
||||
`
|
||||
INSERT INTO kanban_columns (board_id, title, position)
|
||||
VALUES
|
||||
($1, 'Backlog', 0),
|
||||
@@ -48,9 +49,11 @@ async function initDb() {
|
||||
($1, 'Review', 2),
|
||||
($1, 'Done', 3)
|
||||
ON CONFLICT DO NOTHING
|
||||
`, [boardId]);
|
||||
`,
|
||||
[boardId]
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
console.log('База данных инициализирована успешно');
|
||||
} catch (error) {
|
||||
console.error('Ошибка при инициализации базы данных:', error);
|
||||
@@ -59,4 +62,4 @@ async function initDb() {
|
||||
}
|
||||
}
|
||||
|
||||
initDb();
|
||||
initDb();
|
||||
|
||||
Reference in New Issue
Block a user