mirror of
https://github.com/RayLabsHQ/gitea-mirror.git
synced 2025-12-10 05:26:44 +03:00
Merge pull request #1 from ani1609/setup-fixes
✨ Add 'mirrored_location' column to repositories table and improve wa…
This commit is contained in:
@@ -85,6 +85,7 @@ async function ensureTablesExist() {
|
|||||||
clone_url TEXT NOT NULL,
|
clone_url TEXT NOT NULL,
|
||||||
owner TEXT NOT NULL,
|
owner TEXT NOT NULL,
|
||||||
organization TEXT,
|
organization TEXT,
|
||||||
|
mirrored_location TEXT DEFAULT '',
|
||||||
is_private INTEGER NOT NULL DEFAULT 0,
|
is_private INTEGER NOT NULL DEFAULT 0,
|
||||||
is_fork INTEGER NOT NULL DEFAULT 0,
|
is_fork INTEGER NOT NULL DEFAULT 0,
|
||||||
forked_from TEXT,
|
forked_from TEXT,
|
||||||
@@ -300,13 +301,13 @@ async function updateSchema() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check for mirrored_location column in repositories table
|
// Check for mirrored_location column in repositories table
|
||||||
const repoColumns = await client.execute(
|
const repoColumns = await client.execute(`PRAGMA table_info(repositories)`);
|
||||||
`PRAGMA table_info(repositories)`
|
|
||||||
);
|
|
||||||
const repoColumnNames = repoColumns.rows.map((row: any) => row.name);
|
const repoColumnNames = repoColumns.rows.map((row: any) => row.name);
|
||||||
|
|
||||||
if (!repoColumnNames.includes("mirrored_location")) {
|
if (!repoColumnNames.includes("mirrored_location")) {
|
||||||
console.log("Adding missing mirrored_location column to repositories table...");
|
console.log(
|
||||||
|
"Adding missing mirrored_location column to repositories table..."
|
||||||
|
);
|
||||||
await client.execute(
|
await client.execute(
|
||||||
`ALTER TABLE repositories ADD COLUMN mirrored_location TEXT DEFAULT '';`
|
`ALTER TABLE repositories ADD COLUMN mirrored_location TEXT DEFAULT '';`
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user