mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 17:51:57 +00:00
This reverts commit 43e06cef0c.
This migration deadlocked on S2, we didn't expect that we have processes
taking table locks but apparently so.. Reverting for now and will
manually fix up S2 once the build went through. We probably need to make
this one migration per table :rip:
## Test plan
Revert.
This commit is contained in:
parent
c4ea4b64d0
commit
ba9fe24e0f
@ -60,11 +60,5 @@
|
||||
"reason": "We remove constraints and the old tests checked that we were failing"
|
||||
}
|
||||
],
|
||||
"5.4.0": [
|
||||
{
|
||||
"path": "internal/insights/store",
|
||||
"prefix": "TestCreateDashboard",
|
||||
"reason": "Updates all tables to have tenant_id and the old query for GetDashboardGrants used SELECT *"
|
||||
}
|
||||
]
|
||||
"5.4.0": []
|
||||
}
|
||||
|
||||
@ -218,19 +218,6 @@
|
||||
"IsGenerated": "NEVER",
|
||||
"GenerationExpression": "",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Name": "tenant_id",
|
||||
"Index": 4,
|
||||
"TypeName": "integer",
|
||||
"IsNullable": true,
|
||||
"Default": "",
|
||||
"CharacterMaximumLength": 0,
|
||||
"IsIdentity": false,
|
||||
"IdentityGeneration": "",
|
||||
"IsGenerated": "NEVER",
|
||||
"GenerationExpression": "",
|
||||
"Comment": ""
|
||||
}
|
||||
],
|
||||
"Indexes": [
|
||||
@ -246,13 +233,6 @@
|
||||
}
|
||||
],
|
||||
"Constraints": [
|
||||
{
|
||||
"Name": "archived_insight_series_recording_times_tenant_id_fkey",
|
||||
"ConstraintType": "f",
|
||||
"RefTableName": "tenants",
|
||||
"IsDeferrable": false,
|
||||
"ConstraintDefinition": "FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE"
|
||||
},
|
||||
{
|
||||
"Name": "insight_series_id_fkey",
|
||||
"ConstraintType": "f",
|
||||
@ -332,19 +312,6 @@
|
||||
"GenerationExpression": "",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Name": "tenant_id",
|
||||
"Index": 8,
|
||||
"TypeName": "integer",
|
||||
"IsNullable": true,
|
||||
"Default": "",
|
||||
"CharacterMaximumLength": 0,
|
||||
"IsIdentity": false,
|
||||
"IdentityGeneration": "",
|
||||
"IsGenerated": "NEVER",
|
||||
"GenerationExpression": "",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Name": "time",
|
||||
"Index": 2,
|
||||
@ -374,13 +341,6 @@
|
||||
],
|
||||
"Indexes": [],
|
||||
"Constraints": [
|
||||
{
|
||||
"Name": "archived_series_points_tenant_id_fkey",
|
||||
"ConstraintType": "f",
|
||||
"RefTableName": "tenants",
|
||||
"IsDeferrable": false,
|
||||
"ConstraintDefinition": "FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE"
|
||||
},
|
||||
{
|
||||
"Name": "check_repo_fields_specifity",
|
||||
"ConstraintType": "c",
|
||||
@ -480,19 +440,6 @@
|
||||
"GenerationExpression": "",
|
||||
"Comment": "TEMPORARY Do not delete this dashboard when migrating settings."
|
||||
},
|
||||
{
|
||||
"Name": "tenant_id",
|
||||
"Index": 9,
|
||||
"TypeName": "integer",
|
||||
"IsNullable": true,
|
||||
"Default": "",
|
||||
"CharacterMaximumLength": 0,
|
||||
"IsIdentity": false,
|
||||
"IdentityGeneration": "",
|
||||
"IsGenerated": "NEVER",
|
||||
"GenerationExpression": "",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Name": "title",
|
||||
"Index": 2,
|
||||
@ -532,15 +479,7 @@
|
||||
"ConstraintDefinition": "PRIMARY KEY (id)"
|
||||
}
|
||||
],
|
||||
"Constraints": [
|
||||
{
|
||||
"Name": "dashboard_tenant_id_fkey",
|
||||
"ConstraintType": "f",
|
||||
"RefTableName": "tenants",
|
||||
"IsDeferrable": false,
|
||||
"ConstraintDefinition": "FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE"
|
||||
}
|
||||
],
|
||||
"Constraints": null,
|
||||
"Triggers": []
|
||||
},
|
||||
{
|
||||
@ -599,19 +538,6 @@
|
||||
"GenerationExpression": "",
|
||||
"Comment": "Org ID that that receives this grant."
|
||||
},
|
||||
{
|
||||
"Name": "tenant_id",
|
||||
"Index": 6,
|
||||
"TypeName": "integer",
|
||||
"IsNullable": true,
|
||||
"Default": "",
|
||||
"CharacterMaximumLength": 0,
|
||||
"IsIdentity": false,
|
||||
"IdentityGeneration": "",
|
||||
"IsGenerated": "NEVER",
|
||||
"GenerationExpression": "",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Name": "user_id",
|
||||
"Index": 3,
|
||||
@ -685,13 +611,6 @@
|
||||
"RefTableName": "dashboard",
|
||||
"IsDeferrable": false,
|
||||
"ConstraintDefinition": "FOREIGN KEY (dashboard_id) REFERENCES dashboard(id) ON DELETE CASCADE"
|
||||
},
|
||||
{
|
||||
"Name": "dashboard_grants_tenant_id_fkey",
|
||||
"ConstraintType": "f",
|
||||
"RefTableName": "tenants",
|
||||
"IsDeferrable": false,
|
||||
"ConstraintDefinition": "FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE"
|
||||
}
|
||||
],
|
||||
"Triggers": []
|
||||
@ -738,19 +657,6 @@
|
||||
"IsGenerated": "NEVER",
|
||||
"GenerationExpression": "",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Name": "tenant_id",
|
||||
"Index": 4,
|
||||
"TypeName": "integer",
|
||||
"IsNullable": true,
|
||||
"Default": "",
|
||||
"CharacterMaximumLength": 0,
|
||||
"IsIdentity": false,
|
||||
"IdentityGeneration": "",
|
||||
"IsGenerated": "NEVER",
|
||||
"GenerationExpression": "",
|
||||
"Comment": ""
|
||||
}
|
||||
],
|
||||
"Indexes": [
|
||||
@ -809,13 +715,6 @@
|
||||
"RefTableName": "insight_view",
|
||||
"IsDeferrable": false,
|
||||
"ConstraintDefinition": "FOREIGN KEY (insight_view_id) REFERENCES insight_view(id) ON DELETE CASCADE"
|
||||
},
|
||||
{
|
||||
"Name": "dashboard_insight_view_tenant_id_fkey",
|
||||
"ConstraintType": "f",
|
||||
"RefTableName": "tenants",
|
||||
"IsDeferrable": false,
|
||||
"ConstraintDefinition": "FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE"
|
||||
}
|
||||
],
|
||||
"Triggers": []
|
||||
@ -1135,19 +1034,6 @@
|
||||
"IsGenerated": "NEVER",
|
||||
"GenerationExpression": "",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Name": "tenant_id",
|
||||
"Index": 25,
|
||||
"TypeName": "integer",
|
||||
"IsNullable": true,
|
||||
"Default": "",
|
||||
"CharacterMaximumLength": 0,
|
||||
"IsIdentity": false,
|
||||
"IdentityGeneration": "",
|
||||
"IsGenerated": "NEVER",
|
||||
"GenerationExpression": "",
|
||||
"Comment": ""
|
||||
}
|
||||
],
|
||||
"Indexes": [
|
||||
@ -1192,15 +1078,7 @@
|
||||
"ConstraintDefinition": ""
|
||||
}
|
||||
],
|
||||
"Constraints": [
|
||||
{
|
||||
"Name": "insight_series_tenant_id_fkey",
|
||||
"ConstraintType": "f",
|
||||
"RefTableName": "tenants",
|
||||
"IsDeferrable": false,
|
||||
"ConstraintDefinition": "FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE"
|
||||
}
|
||||
],
|
||||
"Constraints": null,
|
||||
"Triggers": []
|
||||
},
|
||||
{
|
||||
@ -1271,19 +1149,6 @@
|
||||
"IsGenerated": "NEVER",
|
||||
"GenerationExpression": "",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Name": "tenant_id",
|
||||
"Index": 6,
|
||||
"TypeName": "integer",
|
||||
"IsNullable": true,
|
||||
"Default": "",
|
||||
"CharacterMaximumLength": 0,
|
||||
"IsIdentity": false,
|
||||
"IdentityGeneration": "",
|
||||
"IsGenerated": "NEVER",
|
||||
"GenerationExpression": "",
|
||||
"Comment": ""
|
||||
}
|
||||
],
|
||||
"Indexes": [
|
||||
@ -1305,13 +1170,6 @@
|
||||
"RefTableName": "insight_series",
|
||||
"IsDeferrable": false,
|
||||
"ConstraintDefinition": "FOREIGN KEY (series_id) REFERENCES insight_series(id) ON DELETE CASCADE"
|
||||
},
|
||||
{
|
||||
"Name": "insight_series_backfill_tenant_id_fkey",
|
||||
"ConstraintType": "f",
|
||||
"RefTableName": "tenants",
|
||||
"IsDeferrable": false,
|
||||
"ConstraintDefinition": "FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE"
|
||||
}
|
||||
],
|
||||
"Triggers": []
|
||||
@ -1372,19 +1230,6 @@
|
||||
"GenerationExpression": "",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Name": "tenant_id",
|
||||
"Index": 6,
|
||||
"TypeName": "integer",
|
||||
"IsNullable": true,
|
||||
"Default": "",
|
||||
"CharacterMaximumLength": 0,
|
||||
"IsIdentity": false,
|
||||
"IdentityGeneration": "",
|
||||
"IsGenerated": "NEVER",
|
||||
"GenerationExpression": "",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Name": "time",
|
||||
"Index": 4,
|
||||
@ -1428,13 +1273,6 @@
|
||||
"RefTableName": "insight_series",
|
||||
"IsDeferrable": false,
|
||||
"ConstraintDefinition": "FOREIGN KEY (series_id) REFERENCES insight_series(id) ON DELETE CASCADE"
|
||||
},
|
||||
{
|
||||
"Name": "insight_series_incomplete_points_tenant_id_fkey",
|
||||
"ConstraintType": "f",
|
||||
"RefTableName": "tenants",
|
||||
"IsDeferrable": false,
|
||||
"ConstraintDefinition": "FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE"
|
||||
}
|
||||
],
|
||||
"Triggers": []
|
||||
@ -1481,19 +1319,6 @@
|
||||
"IsGenerated": "NEVER",
|
||||
"GenerationExpression": "",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Name": "tenant_id",
|
||||
"Index": 4,
|
||||
"TypeName": "integer",
|
||||
"IsNullable": true,
|
||||
"Default": "",
|
||||
"CharacterMaximumLength": 0,
|
||||
"IsIdentity": false,
|
||||
"IdentityGeneration": "",
|
||||
"IsGenerated": "NEVER",
|
||||
"GenerationExpression": "",
|
||||
"Comment": ""
|
||||
}
|
||||
],
|
||||
"Indexes": [
|
||||
@ -1515,13 +1340,6 @@
|
||||
"RefTableName": "insight_series",
|
||||
"IsDeferrable": false,
|
||||
"ConstraintDefinition": "FOREIGN KEY (insight_series_id) REFERENCES insight_series(id) ON DELETE CASCADE"
|
||||
},
|
||||
{
|
||||
"Name": "insight_series_recording_times_tenant_id_fkey",
|
||||
"ConstraintType": "f",
|
||||
"RefTableName": "tenants",
|
||||
"IsDeferrable": false,
|
||||
"ConstraintDefinition": "FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE"
|
||||
}
|
||||
],
|
||||
"Triggers": []
|
||||
@ -1686,19 +1504,6 @@
|
||||
"GenerationExpression": "",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Name": "tenant_id",
|
||||
"Index": 15,
|
||||
"TypeName": "integer",
|
||||
"IsNullable": true,
|
||||
"Default": "",
|
||||
"CharacterMaximumLength": 0,
|
||||
"IsIdentity": false,
|
||||
"IdentityGeneration": "",
|
||||
"IsGenerated": "NEVER",
|
||||
"GenerationExpression": "",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Name": "title",
|
||||
"Index": 2,
|
||||
@ -1748,15 +1553,7 @@
|
||||
"ConstraintDefinition": ""
|
||||
}
|
||||
],
|
||||
"Constraints": [
|
||||
{
|
||||
"Name": "insight_view_tenant_id_fkey",
|
||||
"ConstraintType": "f",
|
||||
"RefTableName": "tenants",
|
||||
"IsDeferrable": false,
|
||||
"ConstraintDefinition": "FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE"
|
||||
}
|
||||
],
|
||||
"Constraints": null,
|
||||
"Triggers": []
|
||||
},
|
||||
{
|
||||
@ -1815,19 +1612,6 @@
|
||||
"GenerationExpression": "",
|
||||
"Comment": "Org ID that that receives this grant."
|
||||
},
|
||||
{
|
||||
"Name": "tenant_id",
|
||||
"Index": 6,
|
||||
"TypeName": "integer",
|
||||
"IsNullable": true,
|
||||
"Default": "",
|
||||
"CharacterMaximumLength": 0,
|
||||
"IsIdentity": false,
|
||||
"IdentityGeneration": "",
|
||||
"IsGenerated": "NEVER",
|
||||
"GenerationExpression": "",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Name": "user_id",
|
||||
"Index": 3,
|
||||
@ -1901,13 +1685,6 @@
|
||||
"RefTableName": "insight_view",
|
||||
"IsDeferrable": false,
|
||||
"ConstraintDefinition": "FOREIGN KEY (insight_view_id) REFERENCES insight_view(id) ON DELETE CASCADE"
|
||||
},
|
||||
{
|
||||
"Name": "insight_view_grants_tenant_id_fkey",
|
||||
"ConstraintType": "f",
|
||||
"RefTableName": "tenants",
|
||||
"IsDeferrable": false,
|
||||
"ConstraintDefinition": "FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE"
|
||||
}
|
||||
],
|
||||
"Triggers": []
|
||||
@ -1967,19 +1744,6 @@
|
||||
"IsGenerated": "NEVER",
|
||||
"GenerationExpression": "",
|
||||
"Comment": "Stroke color metadata for this data series. This may render in a chart depending on the view type."
|
||||
},
|
||||
{
|
||||
"Name": "tenant_id",
|
||||
"Index": 5,
|
||||
"TypeName": "integer",
|
||||
"IsNullable": true,
|
||||
"Default": "",
|
||||
"CharacterMaximumLength": 0,
|
||||
"IsIdentity": false,
|
||||
"IdentityGeneration": "",
|
||||
"IsGenerated": "NEVER",
|
||||
"GenerationExpression": "",
|
||||
"Comment": ""
|
||||
}
|
||||
],
|
||||
"Indexes": [
|
||||
@ -2008,13 +1772,6 @@
|
||||
"RefTableName": "insight_view",
|
||||
"IsDeferrable": false,
|
||||
"ConstraintDefinition": "FOREIGN KEY (insight_view_id) REFERENCES insight_view(id) ON DELETE CASCADE"
|
||||
},
|
||||
{
|
||||
"Name": "insight_view_series_tenant_id_fkey",
|
||||
"ConstraintType": "f",
|
||||
"RefTableName": "tenants",
|
||||
"IsDeferrable": false,
|
||||
"ConstraintDefinition": "FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE"
|
||||
}
|
||||
],
|
||||
"Triggers": []
|
||||
@ -2192,19 +1949,6 @@
|
||||
"GenerationExpression": "",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Name": "tenant_id",
|
||||
"Index": 15,
|
||||
"TypeName": "integer",
|
||||
"IsNullable": true,
|
||||
"Default": "",
|
||||
"CharacterMaximumLength": 0,
|
||||
"IsIdentity": false,
|
||||
"IdentityGeneration": "",
|
||||
"IsGenerated": "NEVER",
|
||||
"GenerationExpression": "",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Name": "worker_hostname",
|
||||
"Index": 12,
|
||||
@ -2248,13 +1992,6 @@
|
||||
"RefTableName": "insight_series_backfill",
|
||||
"IsDeferrable": false,
|
||||
"ConstraintDefinition": "FOREIGN KEY (backfill_id) REFERENCES insight_series_backfill(id) ON DELETE CASCADE"
|
||||
},
|
||||
{
|
||||
"Name": "insights_background_jobs_tenant_id_fkey",
|
||||
"ConstraintType": "f",
|
||||
"RefTableName": "tenants",
|
||||
"IsDeferrable": false,
|
||||
"ConstraintDefinition": "FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE"
|
||||
}
|
||||
],
|
||||
"Triggers": []
|
||||
@ -2445,19 +2182,6 @@
|
||||
"GenerationExpression": "",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Name": "tenant_id",
|
||||
"Index": 16,
|
||||
"TypeName": "integer",
|
||||
"IsNullable": true,
|
||||
"Default": "",
|
||||
"CharacterMaximumLength": 0,
|
||||
"IsIdentity": false,
|
||||
"IdentityGeneration": "",
|
||||
"IsGenerated": "NEVER",
|
||||
"GenerationExpression": "",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Name": "worker_hostname",
|
||||
"Index": 12,
|
||||
@ -2484,15 +2208,7 @@
|
||||
"ConstraintDefinition": "PRIMARY KEY (id)"
|
||||
}
|
||||
],
|
||||
"Constraints": [
|
||||
{
|
||||
"Name": "insights_data_retention_jobs_tenant_id_fkey",
|
||||
"ConstraintType": "f",
|
||||
"RefTableName": "tenants",
|
||||
"IsDeferrable": false,
|
||||
"ConstraintDefinition": "FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE"
|
||||
}
|
||||
],
|
||||
"Constraints": null,
|
||||
"Triggers": []
|
||||
},
|
||||
{
|
||||
@ -2524,19 +2240,6 @@
|
||||
"IsGenerated": "NEVER",
|
||||
"GenerationExpression": "",
|
||||
"Comment": "Metadata about some event, this can be any arbitrary JSON emtadata which will be returned when querying events, and can be filtered on and grouped using jsonb operators ?, ?\u0026, ?|, and @\u003e. This should be small data only."
|
||||
},
|
||||
{
|
||||
"Name": "tenant_id",
|
||||
"Index": 3,
|
||||
"TypeName": "integer",
|
||||
"IsNullable": true,
|
||||
"Default": "",
|
||||
"CharacterMaximumLength": 0,
|
||||
"IsIdentity": false,
|
||||
"IdentityGeneration": "",
|
||||
"IsGenerated": "NEVER",
|
||||
"GenerationExpression": "",
|
||||
"Comment": ""
|
||||
}
|
||||
],
|
||||
"Indexes": [
|
||||
@ -2571,15 +2274,7 @@
|
||||
"ConstraintDefinition": ""
|
||||
}
|
||||
],
|
||||
"Constraints": [
|
||||
{
|
||||
"Name": "metadata_tenant_id_fkey",
|
||||
"ConstraintType": "f",
|
||||
"RefTableName": "tenants",
|
||||
"IsDeferrable": false,
|
||||
"ConstraintDefinition": "FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE"
|
||||
}
|
||||
],
|
||||
"Constraints": null,
|
||||
"Triggers": []
|
||||
},
|
||||
{
|
||||
@ -2866,19 +2561,6 @@
|
||||
"GenerationExpression": "",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Name": "tenant_id",
|
||||
"Index": 12,
|
||||
"TypeName": "integer",
|
||||
"IsNullable": true,
|
||||
"Default": "",
|
||||
"CharacterMaximumLength": 0,
|
||||
"IsIdentity": false,
|
||||
"IdentityGeneration": "",
|
||||
"IsGenerated": "NEVER",
|
||||
"GenerationExpression": "",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Name": "total_count",
|
||||
"Index": 8,
|
||||
@ -2905,15 +2587,7 @@
|
||||
"ConstraintDefinition": "PRIMARY KEY (id)"
|
||||
}
|
||||
],
|
||||
"Constraints": [
|
||||
{
|
||||
"Name": "repo_iterator_tenant_id_fkey",
|
||||
"ConstraintType": "f",
|
||||
"RefTableName": "tenants",
|
||||
"IsDeferrable": false,
|
||||
"ConstraintDefinition": "FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE"
|
||||
}
|
||||
],
|
||||
"Constraints": null,
|
||||
"Triggers": []
|
||||
},
|
||||
{
|
||||
@ -2984,19 +2658,6 @@
|
||||
"IsGenerated": "NEVER",
|
||||
"GenerationExpression": "",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Name": "tenant_id",
|
||||
"Index": 6,
|
||||
"TypeName": "integer",
|
||||
"IsNullable": true,
|
||||
"Default": "",
|
||||
"CharacterMaximumLength": 0,
|
||||
"IsIdentity": false,
|
||||
"IdentityGeneration": "",
|
||||
"IsGenerated": "NEVER",
|
||||
"GenerationExpression": "",
|
||||
"Comment": ""
|
||||
}
|
||||
],
|
||||
"Indexes": [
|
||||
@ -3022,13 +2683,6 @@
|
||||
}
|
||||
],
|
||||
"Constraints": [
|
||||
{
|
||||
"Name": "repo_iterator_errors_tenant_id_fkey",
|
||||
"ConstraintType": "f",
|
||||
"RefTableName": "tenants",
|
||||
"IsDeferrable": false,
|
||||
"ConstraintDefinition": "FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE"
|
||||
},
|
||||
{
|
||||
"Name": "repo_iterator_fk",
|
||||
"ConstraintType": "f",
|
||||
@ -3068,19 +2722,6 @@
|
||||
"IsGenerated": "NEVER",
|
||||
"GenerationExpression": "",
|
||||
"Comment": "The repository name string, with unique constraint for table entry deduplication and trigram index for e.g. regex filtering."
|
||||
},
|
||||
{
|
||||
"Name": "tenant_id",
|
||||
"Index": 3,
|
||||
"TypeName": "integer",
|
||||
"IsNullable": true,
|
||||
"Default": "",
|
||||
"CharacterMaximumLength": 0,
|
||||
"IsIdentity": false,
|
||||
"IdentityGeneration": "",
|
||||
"IsGenerated": "NEVER",
|
||||
"GenerationExpression": "",
|
||||
"Comment": ""
|
||||
}
|
||||
],
|
||||
"Indexes": [
|
||||
@ -3122,13 +2763,6 @@
|
||||
"RefTableName": "",
|
||||
"IsDeferrable": false,
|
||||
"ConstraintDefinition": "CHECK (name \u003c\u003e ''::citext)"
|
||||
},
|
||||
{
|
||||
"Name": "repo_names_tenant_id_fkey",
|
||||
"ConstraintType": "f",
|
||||
"RefTableName": "tenants",
|
||||
"IsDeferrable": false,
|
||||
"ConstraintDefinition": "FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE"
|
||||
}
|
||||
],
|
||||
"Triggers": []
|
||||
@ -3215,19 +2849,6 @@
|
||||
"GenerationExpression": "",
|
||||
"Comment": "A unique identifier for the series of data being recorded. This is not an ID from another table, but rather just a unique identifier."
|
||||
},
|
||||
{
|
||||
"Name": "tenant_id",
|
||||
"Index": 9,
|
||||
"TypeName": "integer",
|
||||
"IsNullable": true,
|
||||
"Default": "",
|
||||
"CharacterMaximumLength": 0,
|
||||
"IsIdentity": false,
|
||||
"IdentityGeneration": "",
|
||||
"IsGenerated": "NEVER",
|
||||
"GenerationExpression": "",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Name": "time",
|
||||
"Index": 2,
|
||||
@ -3335,13 +2956,6 @@
|
||||
"RefTableName": "repo_names",
|
||||
"IsDeferrable": true,
|
||||
"ConstraintDefinition": "FOREIGN KEY (repo_name_id) REFERENCES repo_names(id) ON DELETE CASCADE DEFERRABLE"
|
||||
},
|
||||
{
|
||||
"Name": "series_points_tenant_id_fkey",
|
||||
"ConstraintType": "f",
|
||||
"RefTableName": "tenants",
|
||||
"IsDeferrable": false,
|
||||
"ConstraintDefinition": "FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE"
|
||||
}
|
||||
],
|
||||
"Triggers": []
|
||||
@ -3428,19 +3042,6 @@
|
||||
"GenerationExpression": "",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Name": "tenant_id",
|
||||
"Index": 9,
|
||||
"TypeName": "integer",
|
||||
"IsNullable": true,
|
||||
"Default": "",
|
||||
"CharacterMaximumLength": 0,
|
||||
"IsIdentity": false,
|
||||
"IdentityGeneration": "",
|
||||
"IsGenerated": "NEVER",
|
||||
"GenerationExpression": "",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Name": "time",
|
||||
"Index": 2,
|
||||
@ -3527,13 +3128,6 @@
|
||||
"RefTableName": "",
|
||||
"IsDeferrable": false,
|
||||
"ConstraintDefinition": "CHECK (repo_id IS NULL AND repo_name_id IS NULL AND original_repo_name_id IS NULL OR repo_id IS NOT NULL AND repo_name_id IS NOT NULL AND original_repo_name_id IS NOT NULL)"
|
||||
},
|
||||
{
|
||||
"Name": "series_points_snapshots_tenant_id_fkey",
|
||||
"ConstraintType": "f",
|
||||
"RefTableName": "tenants",
|
||||
"IsDeferrable": false,
|
||||
"ConstraintDefinition": "FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE"
|
||||
}
|
||||
],
|
||||
"Triggers": []
|
||||
|
||||
@ -5,11 +5,9 @@
|
||||
insight_series_id | integer | | not null |
|
||||
recording_time | timestamp with time zone | | not null |
|
||||
snapshot | boolean | | not null |
|
||||
tenant_id | integer | | |
|
||||
Indexes:
|
||||
"archived_insight_series_recor_insight_series_id_recording_t_key" UNIQUE CONSTRAINT, btree (insight_series_id, recording_time)
|
||||
Foreign-key constraints:
|
||||
"archived_insight_series_recording_times_tenant_id_fkey" FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
"insight_series_id_fkey" FOREIGN KEY (insight_series_id) REFERENCES insight_series(id) ON DELETE CASCADE
|
||||
|
||||
```
|
||||
@ -25,11 +23,9 @@ Foreign-key constraints:
|
||||
repo_name_id | integer | | |
|
||||
original_repo_name_id | integer | | |
|
||||
capture | text | | |
|
||||
tenant_id | integer | | |
|
||||
Check constraints:
|
||||
"check_repo_fields_specifity" CHECK (repo_id IS NULL AND repo_name_id IS NULL AND original_repo_name_id IS NULL OR repo_id IS NOT NULL AND repo_name_id IS NOT NULL AND original_repo_name_id IS NOT NULL)
|
||||
Foreign-key constraints:
|
||||
"archived_series_points_tenant_id_fkey" FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
"insight_series_series_id_fkey" FOREIGN KEY (series_id) REFERENCES insight_series(series_id) ON DELETE CASCADE
|
||||
|
||||
```
|
||||
@ -46,11 +42,8 @@ Foreign-key constraints:
|
||||
deleted_at | timestamp without time zone | | |
|
||||
save | boolean | | not null | false
|
||||
type | text | | not null | 'standard'::text
|
||||
tenant_id | integer | | |
|
||||
Indexes:
|
||||
"dashboard_pk" PRIMARY KEY, btree (id)
|
||||
Foreign-key constraints:
|
||||
"dashboard_tenant_id_fkey" FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
Referenced by:
|
||||
TABLE "dashboard_grants" CONSTRAINT "dashboard_grants_dashboard_id_fk" FOREIGN KEY (dashboard_id) REFERENCES dashboard(id) ON DELETE CASCADE
|
||||
TABLE "dashboard_insight_view" CONSTRAINT "dashboard_insight_view_dashboard_id_fk" FOREIGN KEY (dashboard_id) REFERENCES dashboard(id) ON DELETE CASCADE
|
||||
@ -80,7 +73,6 @@ Metadata for dashboards of insights
|
||||
user_id | integer | | |
|
||||
org_id | integer | | |
|
||||
global | boolean | | |
|
||||
tenant_id | integer | | |
|
||||
Indexes:
|
||||
"dashboard_grants_pk" PRIMARY KEY, btree (id)
|
||||
"dashboard_grants_dashboard_id_index" btree (dashboard_id)
|
||||
@ -89,7 +81,6 @@ Indexes:
|
||||
"dashboard_grants_user_id_idx" btree (user_id)
|
||||
Foreign-key constraints:
|
||||
"dashboard_grants_dashboard_id_fk" FOREIGN KEY (dashboard_id) REFERENCES dashboard(id) ON DELETE CASCADE
|
||||
"dashboard_grants_tenant_id_fkey" FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
|
||||
```
|
||||
|
||||
@ -108,7 +99,6 @@ Permission grants for dashboards. Each row should represent a unique principal (
|
||||
id | integer | | not null | nextval('dashboard_insight_view_id_seq'::regclass)
|
||||
dashboard_id | integer | | not null |
|
||||
insight_view_id | integer | | not null |
|
||||
tenant_id | integer | | |
|
||||
Indexes:
|
||||
"dashboard_insight_view_pk" PRIMARY KEY, btree (id)
|
||||
"unique_dashboard_id_insight_view_id" UNIQUE CONSTRAINT, btree (dashboard_id, insight_view_id)
|
||||
@ -117,7 +107,6 @@ Indexes:
|
||||
Foreign-key constraints:
|
||||
"dashboard_insight_view_dashboard_id_fk" FOREIGN KEY (dashboard_id) REFERENCES dashboard(id) ON DELETE CASCADE
|
||||
"dashboard_insight_view_insight_view_id_fk" FOREIGN KEY (insight_view_id) REFERENCES insight_view(id) ON DELETE CASCADE
|
||||
"dashboard_insight_view_tenant_id_fkey" FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
|
||||
```
|
||||
|
||||
@ -149,14 +138,11 @@ Foreign-key constraints:
|
||||
supports_augmentation | boolean | | not null | true
|
||||
repository_criteria | text | | |
|
||||
query_old | text | | |
|
||||
tenant_id | integer | | |
|
||||
Indexes:
|
||||
"insight_series_pkey" PRIMARY KEY, btree (id)
|
||||
"insight_series_series_id_unique_idx" UNIQUE, btree (series_id)
|
||||
"insight_series_deleted_at_idx" btree (deleted_at)
|
||||
"insight_series_next_recording_after_idx" btree (next_recording_after)
|
||||
Foreign-key constraints:
|
||||
"insight_series_tenant_id_fkey" FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
Referenced by:
|
||||
TABLE "insight_series_backfill" CONSTRAINT "insight_series_backfill_series_id_fk" FOREIGN KEY (series_id) REFERENCES insight_series(id) ON DELETE CASCADE
|
||||
TABLE "archived_insight_series_recording_times" CONSTRAINT "insight_series_id_fkey" FOREIGN KEY (insight_series_id) REFERENCES insight_series(id) ON DELETE CASCADE
|
||||
@ -202,12 +188,10 @@ Data series that comprise code insights.
|
||||
repo_iterator_id | integer | | |
|
||||
estimated_cost | double precision | | |
|
||||
state | text | | not null | 'new'::text
|
||||
tenant_id | integer | | |
|
||||
Indexes:
|
||||
"insight_series_backfill_pk" PRIMARY KEY, btree (id)
|
||||
Foreign-key constraints:
|
||||
"insight_series_backfill_series_id_fk" FOREIGN KEY (series_id) REFERENCES insight_series(id) ON DELETE CASCADE
|
||||
"insight_series_backfill_tenant_id_fkey" FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
Referenced by:
|
||||
TABLE "insights_background_jobs" CONSTRAINT "insights_background_jobs_backfill_id_fkey" FOREIGN KEY (backfill_id) REFERENCES insight_series_backfill(id) ON DELETE CASCADE
|
||||
|
||||
@ -222,13 +206,11 @@ Referenced by:
|
||||
reason | text | | not null |
|
||||
time | timestamp without time zone | | not null |
|
||||
repo_id | integer | | |
|
||||
tenant_id | integer | | |
|
||||
Indexes:
|
||||
"insight_series_incomplete_points_pk" PRIMARY KEY, btree (id)
|
||||
"insight_series_incomplete_points_unique_idx" UNIQUE, btree (series_id, reason, "time", repo_id)
|
||||
Foreign-key constraints:
|
||||
"insight_series_incomplete_points_series_id_fk" FOREIGN KEY (series_id) REFERENCES insight_series(id) ON DELETE CASCADE
|
||||
"insight_series_incomplete_points_tenant_id_fkey" FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
|
||||
```
|
||||
|
||||
@ -239,12 +221,10 @@ Foreign-key constraints:
|
||||
insight_series_id | integer | | |
|
||||
recording_time | timestamp with time zone | | |
|
||||
snapshot | boolean | | |
|
||||
tenant_id | integer | | |
|
||||
Indexes:
|
||||
"insight_series_recording_time_insight_series_id_recording_t_key" UNIQUE CONSTRAINT, btree (insight_series_id, recording_time)
|
||||
Foreign-key constraints:
|
||||
"insight_series_id_fkey" FOREIGN KEY (insight_series_id) REFERENCES insight_series(id) ON DELETE CASCADE
|
||||
"insight_series_recording_times_tenant_id_fkey" FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
|
||||
```
|
||||
|
||||
@ -266,12 +246,9 @@ Foreign-key constraints:
|
||||
series_sort_direction | series_sort_direction_enum | | |
|
||||
series_limit | integer | | |
|
||||
series_num_samples | integer | | |
|
||||
tenant_id | integer | | |
|
||||
Indexes:
|
||||
"insight_view_pkey" PRIMARY KEY, btree (id)
|
||||
"insight_view_unique_id_unique_idx" UNIQUE, btree (unique_id)
|
||||
Foreign-key constraints:
|
||||
"insight_view_tenant_id_fkey" FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
Referenced by:
|
||||
TABLE "dashboard_insight_view" CONSTRAINT "dashboard_insight_view_insight_view_id_fk" FOREIGN KEY (insight_view_id) REFERENCES insight_view(id) ON DELETE CASCADE
|
||||
TABLE "insight_view_grants" CONSTRAINT "insight_view_grants_insight_view_id_fk" FOREIGN KEY (insight_view_id) REFERENCES insight_view(id) ON DELETE CASCADE
|
||||
@ -302,7 +279,6 @@ Views for insight data series. An insight view is an abstraction on top of an in
|
||||
user_id | integer | | |
|
||||
org_id | integer | | |
|
||||
global | boolean | | |
|
||||
tenant_id | integer | | |
|
||||
Indexes:
|
||||
"insight_view_grants_pk" PRIMARY KEY, btree (id)
|
||||
"insight_view_grants_global_idx" btree (global) WHERE global IS TRUE
|
||||
@ -311,7 +287,6 @@ Indexes:
|
||||
"insight_view_grants_user_id_idx" btree (user_id)
|
||||
Foreign-key constraints:
|
||||
"insight_view_grants_insight_view_id_fk" FOREIGN KEY (insight_view_id) REFERENCES insight_view(id) ON DELETE CASCADE
|
||||
"insight_view_grants_tenant_id_fkey" FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
|
||||
```
|
||||
|
||||
@ -331,13 +306,11 @@ Permission grants for insight views. Each row should represent a unique principa
|
||||
insight_series_id | integer | | not null |
|
||||
label | text | | |
|
||||
stroke | text | | |
|
||||
tenant_id | integer | | |
|
||||
Indexes:
|
||||
"insight_view_series_pkey" PRIMARY KEY, btree (insight_view_id, insight_series_id)
|
||||
Foreign-key constraints:
|
||||
"insight_view_series_insight_series_id_fkey" FOREIGN KEY (insight_series_id) REFERENCES insight_series(id)
|
||||
"insight_view_series_insight_view_id_fkey" FOREIGN KEY (insight_view_id) REFERENCES insight_view(id) ON DELETE CASCADE
|
||||
"insight_view_series_tenant_id_fkey" FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
|
||||
```
|
||||
|
||||
@ -369,13 +342,11 @@ Join table to correlate data series with insight views
|
||||
worker_hostname | text | | not null | ''::text
|
||||
cancel | boolean | | not null | false
|
||||
backfill_id | integer | | |
|
||||
tenant_id | integer | | |
|
||||
Indexes:
|
||||
"insights_background_jobs_pkey" PRIMARY KEY, btree (id)
|
||||
"insights_jobs_state_idx" btree (state)
|
||||
Foreign-key constraints:
|
||||
"insights_background_jobs_backfill_id_fkey" FOREIGN KEY (backfill_id) REFERENCES insight_series_backfill(id) ON DELETE CASCADE
|
||||
"insights_background_jobs_tenant_id_fkey" FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
|
||||
```
|
||||
|
||||
@ -398,27 +369,21 @@ Foreign-key constraints:
|
||||
cancel | boolean | | not null | false
|
||||
series_id | integer | | not null |
|
||||
series_id_string | text | | not null | ''::text
|
||||
tenant_id | integer | | |
|
||||
Indexes:
|
||||
"insights_data_retention_jobs_pkey" PRIMARY KEY, btree (id)
|
||||
Foreign-key constraints:
|
||||
"insights_data_retention_jobs_tenant_id_fkey" FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
|
||||
```
|
||||
|
||||
# Table "public.metadata"
|
||||
```
|
||||
Column | Type | Collation | Nullable | Default
|
||||
-----------+---------+-----------+----------+--------------------------------------
|
||||
id | bigint | | not null | nextval('metadata_id_seq'::regclass)
|
||||
metadata | jsonb | | not null |
|
||||
tenant_id | integer | | |
|
||||
Column | Type | Collation | Nullable | Default
|
||||
----------+--------+-----------+----------+--------------------------------------
|
||||
id | bigint | | not null | nextval('metadata_id_seq'::regclass)
|
||||
metadata | jsonb | | not null |
|
||||
Indexes:
|
||||
"metadata_pkey" PRIMARY KEY, btree (id)
|
||||
"metadata_metadata_unique_idx" UNIQUE, btree (metadata)
|
||||
"metadata_metadata_gin" gin (metadata)
|
||||
Foreign-key constraints:
|
||||
"metadata_tenant_id_fkey" FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
Referenced by:
|
||||
TABLE "series_points" CONSTRAINT "series_points_metadata_id_fkey" FOREIGN KEY (metadata_id) REFERENCES metadata(id) ON DELETE CASCADE DEFERRABLE
|
||||
|
||||
@ -464,11 +429,8 @@ Indexes:
|
||||
success_count | integer | | not null | 0
|
||||
repos | integer[] | | |
|
||||
repo_cursor | integer | | | 0
|
||||
tenant_id | integer | | |
|
||||
Indexes:
|
||||
"repo_iterator_pk" PRIMARY KEY, btree (id)
|
||||
Foreign-key constraints:
|
||||
"repo_iterator_tenant_id_fkey" FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
Referenced by:
|
||||
TABLE "repo_iterator_errors" CONSTRAINT "repo_iterator_fk" FOREIGN KEY (repo_iterator_id) REFERENCES repo_iterator(id)
|
||||
|
||||
@ -483,31 +445,26 @@ Referenced by:
|
||||
repo_id | integer | | not null |
|
||||
error_message | text[] | | not null |
|
||||
failure_count | integer | | | 1
|
||||
tenant_id | integer | | |
|
||||
Indexes:
|
||||
"repo_iterator_errors_pk" PRIMARY KEY, btree (id)
|
||||
"repo_iterator_errors_fk_idx" btree (repo_iterator_id)
|
||||
Foreign-key constraints:
|
||||
"repo_iterator_errors_tenant_id_fkey" FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
"repo_iterator_fk" FOREIGN KEY (repo_iterator_id) REFERENCES repo_iterator(id)
|
||||
|
||||
```
|
||||
|
||||
# Table "public.repo_names"
|
||||
```
|
||||
Column | Type | Collation | Nullable | Default
|
||||
-----------+---------+-----------+----------+----------------------------------------
|
||||
id | bigint | | not null | nextval('repo_names_id_seq'::regclass)
|
||||
name | citext | | not null |
|
||||
tenant_id | integer | | |
|
||||
Column | Type | Collation | Nullable | Default
|
||||
--------+--------+-----------+----------+----------------------------------------
|
||||
id | bigint | | not null | nextval('repo_names_id_seq'::regclass)
|
||||
name | citext | | not null |
|
||||
Indexes:
|
||||
"repo_names_pkey" PRIMARY KEY, btree (id)
|
||||
"repo_names_name_unique_idx" UNIQUE, btree (name)
|
||||
"repo_names_name_trgm" gin (lower(name::text) gin_trgm_ops)
|
||||
Check constraints:
|
||||
"check_name_nonempty" CHECK (name <> ''::citext)
|
||||
Foreign-key constraints:
|
||||
"repo_names_tenant_id_fkey" FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
Referenced by:
|
||||
TABLE "series_points" CONSTRAINT "series_points_original_repo_name_id_fkey" FOREIGN KEY (original_repo_name_id) REFERENCES repo_names(id) ON DELETE CASCADE DEFERRABLE
|
||||
TABLE "series_points" CONSTRAINT "series_points_repo_name_id_fkey" FOREIGN KEY (repo_name_id) REFERENCES repo_names(id) ON DELETE CASCADE DEFERRABLE
|
||||
@ -532,7 +489,6 @@ Records repository names, both historical and present, using a unique repository
|
||||
repo_name_id | integer | | |
|
||||
original_repo_name_id | integer | | |
|
||||
capture | text | | |
|
||||
tenant_id | integer | | |
|
||||
Indexes:
|
||||
"series_points_original_repo_name_id_btree" btree (original_repo_name_id)
|
||||
"series_points_repo_id_btree" btree (repo_id)
|
||||
@ -545,7 +501,6 @@ Foreign-key constraints:
|
||||
"series_points_metadata_id_fkey" FOREIGN KEY (metadata_id) REFERENCES metadata(id) ON DELETE CASCADE DEFERRABLE
|
||||
"series_points_original_repo_name_id_fkey" FOREIGN KEY (original_repo_name_id) REFERENCES repo_names(id) ON DELETE CASCADE DEFERRABLE
|
||||
"series_points_repo_name_id_fkey" FOREIGN KEY (repo_name_id) REFERENCES repo_names(id) ON DELETE CASCADE DEFERRABLE
|
||||
"series_points_tenant_id_fkey" FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
|
||||
```
|
||||
|
||||
@ -577,7 +532,6 @@ Records events over time associated with a repository (or none, i.e. globally) w
|
||||
repo_name_id | integer | | |
|
||||
original_repo_name_id | integer | | |
|
||||
capture | text | | |
|
||||
tenant_id | integer | | |
|
||||
Indexes:
|
||||
"series_points_snapshots_original_repo_name_id_idx" btree (original_repo_name_id)
|
||||
"series_points_snapshots_repo_id_idx" btree (repo_id)
|
||||
@ -586,8 +540,6 @@ Indexes:
|
||||
"series_points_snapshots_series_id_repo_id_time_idx" btree (series_id, repo_id, "time")
|
||||
Check constraints:
|
||||
"check_repo_fields_specifity" CHECK (repo_id IS NULL AND repo_name_id IS NULL AND original_repo_name_id IS NULL OR repo_id IS NOT NULL AND repo_name_id IS NOT NULL AND original_repo_name_id IS NOT NULL)
|
||||
Foreign-key constraints:
|
||||
"series_points_snapshots_tenant_id_fkey" FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
|
||||
```
|
||||
|
||||
@ -607,27 +559,6 @@ Indexes:
|
||||
Check constraints:
|
||||
"tenant_name_length" CHECK (char_length(name) <= 32 AND char_length(name) >= 3)
|
||||
"tenant_name_valid_chars" CHECK (name ~ '^[a-z](?:[a-z0-9\_-])*[a-z0-9]$'::text)
|
||||
Referenced by:
|
||||
TABLE "archived_insight_series_recording_times" CONSTRAINT "archived_insight_series_recording_times_tenant_id_fkey" FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
TABLE "archived_series_points" CONSTRAINT "archived_series_points_tenant_id_fkey" FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
TABLE "dashboard_grants" CONSTRAINT "dashboard_grants_tenant_id_fkey" FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
TABLE "dashboard_insight_view" CONSTRAINT "dashboard_insight_view_tenant_id_fkey" FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
TABLE "dashboard" CONSTRAINT "dashboard_tenant_id_fkey" FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
TABLE "insight_series_backfill" CONSTRAINT "insight_series_backfill_tenant_id_fkey" FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
TABLE "insight_series_incomplete_points" CONSTRAINT "insight_series_incomplete_points_tenant_id_fkey" FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
TABLE "insight_series_recording_times" CONSTRAINT "insight_series_recording_times_tenant_id_fkey" FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
TABLE "insight_series" CONSTRAINT "insight_series_tenant_id_fkey" FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
TABLE "insight_view_grants" CONSTRAINT "insight_view_grants_tenant_id_fkey" FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
TABLE "insight_view_series" CONSTRAINT "insight_view_series_tenant_id_fkey" FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
TABLE "insight_view" CONSTRAINT "insight_view_tenant_id_fkey" FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
TABLE "insights_background_jobs" CONSTRAINT "insights_background_jobs_tenant_id_fkey" FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
TABLE "insights_data_retention_jobs" CONSTRAINT "insights_data_retention_jobs_tenant_id_fkey" FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
TABLE "metadata" CONSTRAINT "metadata_tenant_id_fkey" FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
TABLE "repo_iterator_errors" CONSTRAINT "repo_iterator_errors_tenant_id_fkey" FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
TABLE "repo_iterator" CONSTRAINT "repo_iterator_tenant_id_fkey" FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
TABLE "repo_names" CONSTRAINT "repo_names_tenant_id_fkey" FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
TABLE "series_points_snapshots" CONSTRAINT "series_points_snapshots_tenant_id_fkey" FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
TABLE "series_points" CONSTRAINT "series_points_tenant_id_fkey" FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
|
||||
```
|
||||
|
||||
|
||||
@ -139,19 +139,6 @@
|
||||
"IsGenerated": "NEVER",
|
||||
"GenerationExpression": "",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Name": "tenant_id",
|
||||
"Index": 3,
|
||||
"TypeName": "integer",
|
||||
"IsNullable": true,
|
||||
"Default": "",
|
||||
"CharacterMaximumLength": 0,
|
||||
"IsIdentity": false,
|
||||
"IdentityGeneration": "",
|
||||
"IsGenerated": "NEVER",
|
||||
"GenerationExpression": "",
|
||||
"Comment": ""
|
||||
}
|
||||
],
|
||||
"Indexes": [
|
||||
@ -176,15 +163,7 @@
|
||||
"ConstraintDefinition": ""
|
||||
}
|
||||
],
|
||||
"Constraints": [
|
||||
{
|
||||
"Name": "codeintel_last_reconcile_tenant_id_fkey",
|
||||
"ConstraintType": "f",
|
||||
"RefTableName": "tenants",
|
||||
"IsDeferrable": false,
|
||||
"ConstraintDefinition": "FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE"
|
||||
}
|
||||
],
|
||||
"Constraints": null,
|
||||
"Triggers": []
|
||||
},
|
||||
{
|
||||
@ -230,19 +209,6 @@
|
||||
"GenerationExpression": "",
|
||||
"Comment": "An auto-generated identifier. This column is used as a foreign key target to reduce occurrences of the full document path value."
|
||||
},
|
||||
{
|
||||
"Name": "tenant_id",
|
||||
"Index": 5,
|
||||
"TypeName": "integer",
|
||||
"IsNullable": true,
|
||||
"Default": "",
|
||||
"CharacterMaximumLength": 0,
|
||||
"IsIdentity": false,
|
||||
"IdentityGeneration": "",
|
||||
"IsGenerated": "NEVER",
|
||||
"GenerationExpression": "",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Name": "upload_id",
|
||||
"Index": 2,
|
||||
@ -296,13 +262,6 @@
|
||||
"RefTableName": "codeintel_scip_documents",
|
||||
"IsDeferrable": false,
|
||||
"ConstraintDefinition": "FOREIGN KEY (document_id) REFERENCES codeintel_scip_documents(id)"
|
||||
},
|
||||
{
|
||||
"Name": "codeintel_scip_document_lookup_tenant_id_fkey",
|
||||
"ConstraintType": "f",
|
||||
"RefTableName": "tenants",
|
||||
"IsDeferrable": false,
|
||||
"ConstraintDefinition": "FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE"
|
||||
}
|
||||
],
|
||||
"Triggers": [
|
||||
@ -346,19 +305,6 @@
|
||||
"GenerationExpression": "",
|
||||
"Comment": "A lower-bound on the `schema_version` values of the records in the table [`codeintel_scip_document_lookup`](#table-publiccodeintel_scip_document_lookup) where the `upload_id` column matches the associated SCIP index."
|
||||
},
|
||||
{
|
||||
"Name": "tenant_id",
|
||||
"Index": 4,
|
||||
"TypeName": "integer",
|
||||
"IsNullable": true,
|
||||
"Default": "",
|
||||
"CharacterMaximumLength": 0,
|
||||
"IsIdentity": false,
|
||||
"IdentityGeneration": "",
|
||||
"IsGenerated": "NEVER",
|
||||
"GenerationExpression": "",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Name": "upload_id",
|
||||
"Index": 1,
|
||||
@ -385,15 +331,7 @@
|
||||
"ConstraintDefinition": "PRIMARY KEY (upload_id)"
|
||||
}
|
||||
],
|
||||
"Constraints": [
|
||||
{
|
||||
"Name": "codeintel_scip_document_lookup_schema_versions_tenant_id_fkey",
|
||||
"ConstraintType": "f",
|
||||
"RefTableName": "tenants",
|
||||
"IsDeferrable": false,
|
||||
"ConstraintDefinition": "FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE"
|
||||
}
|
||||
],
|
||||
"Constraints": null,
|
||||
"Triggers": []
|
||||
},
|
||||
{
|
||||
@ -451,19 +389,6 @@
|
||||
"IsGenerated": "NEVER",
|
||||
"GenerationExpression": "",
|
||||
"Comment": "The schema version of this row - used to determine presence and encoding of (future) denormalized data."
|
||||
},
|
||||
{
|
||||
"Name": "tenant_id",
|
||||
"Index": 6,
|
||||
"TypeName": "integer",
|
||||
"IsNullable": true,
|
||||
"Default": "",
|
||||
"CharacterMaximumLength": 0,
|
||||
"IsIdentity": false,
|
||||
"IdentityGeneration": "",
|
||||
"IsGenerated": "NEVER",
|
||||
"GenerationExpression": "",
|
||||
"Comment": ""
|
||||
}
|
||||
],
|
||||
"Indexes": [
|
||||
@ -488,15 +413,7 @@
|
||||
"ConstraintDefinition": "PRIMARY KEY (id)"
|
||||
}
|
||||
],
|
||||
"Constraints": [
|
||||
{
|
||||
"Name": "codeintel_scip_documents_tenant_id_fkey",
|
||||
"ConstraintType": "f",
|
||||
"RefTableName": "tenants",
|
||||
"IsDeferrable": false,
|
||||
"ConstraintDefinition": "FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE"
|
||||
}
|
||||
],
|
||||
"Constraints": null,
|
||||
"Triggers": []
|
||||
},
|
||||
{
|
||||
@ -541,19 +458,6 @@
|
||||
"IsGenerated": "NEVER",
|
||||
"GenerationExpression": "",
|
||||
"Comment": "The time that the log entry was inserted."
|
||||
},
|
||||
{
|
||||
"Name": "tenant_id",
|
||||
"Index": 4,
|
||||
"TypeName": "integer",
|
||||
"IsNullable": true,
|
||||
"Default": "",
|
||||
"CharacterMaximumLength": 0,
|
||||
"IsIdentity": false,
|
||||
"IdentityGeneration": "",
|
||||
"IsGenerated": "NEVER",
|
||||
"GenerationExpression": "",
|
||||
"Comment": ""
|
||||
}
|
||||
],
|
||||
"Indexes": [
|
||||
@ -578,15 +482,7 @@
|
||||
"ConstraintDefinition": ""
|
||||
}
|
||||
],
|
||||
"Constraints": [
|
||||
{
|
||||
"Name": "codeintel_scip_documents_dereference_logs_tenant_id_fkey",
|
||||
"ConstraintType": "f",
|
||||
"RefTableName": "tenants",
|
||||
"IsDeferrable": false,
|
||||
"ConstraintDefinition": "FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE"
|
||||
}
|
||||
],
|
||||
"Constraints": null,
|
||||
"Triggers": []
|
||||
},
|
||||
{
|
||||
@ -619,19 +515,6 @@
|
||||
"GenerationExpression": "",
|
||||
"Comment": "The version of the SCIP protocol used to encode this index."
|
||||
},
|
||||
{
|
||||
"Name": "tenant_id",
|
||||
"Index": 8,
|
||||
"TypeName": "integer",
|
||||
"IsNullable": true,
|
||||
"Default": "",
|
||||
"CharacterMaximumLength": 0,
|
||||
"IsIdentity": false,
|
||||
"IdentityGeneration": "",
|
||||
"IsGenerated": "NEVER",
|
||||
"GenerationExpression": "",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Name": "text_document_encoding",
|
||||
"Index": 6,
|
||||
@ -720,15 +603,7 @@
|
||||
"ConstraintDefinition": ""
|
||||
}
|
||||
],
|
||||
"Constraints": [
|
||||
{
|
||||
"Name": "codeintel_scip_metadata_tenant_id_fkey",
|
||||
"ConstraintType": "f",
|
||||
"RefTableName": "tenants",
|
||||
"IsDeferrable": false,
|
||||
"ConstraintDefinition": "FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE"
|
||||
}
|
||||
],
|
||||
"Constraints": null,
|
||||
"Triggers": []
|
||||
},
|
||||
{
|
||||
@ -774,19 +649,6 @@
|
||||
"GenerationExpression": "",
|
||||
"Comment": "The identifier of the segment that forms the prefix of this symbol, if any."
|
||||
},
|
||||
{
|
||||
"Name": "tenant_id",
|
||||
"Index": 5,
|
||||
"TypeName": "integer",
|
||||
"IsNullable": true,
|
||||
"Default": "",
|
||||
"CharacterMaximumLength": 0,
|
||||
"IsIdentity": false,
|
||||
"IdentityGeneration": "",
|
||||
"IsGenerated": "NEVER",
|
||||
"GenerationExpression": "",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Name": "upload_id",
|
||||
"Index": 2,
|
||||
@ -833,15 +695,7 @@
|
||||
"ConstraintDefinition": ""
|
||||
}
|
||||
],
|
||||
"Constraints": [
|
||||
{
|
||||
"Name": "codeintel_scip_symbol_names_tenant_id_fkey",
|
||||
"ConstraintType": "f",
|
||||
"RefTableName": "tenants",
|
||||
"IsDeferrable": false,
|
||||
"ConstraintDefinition": "FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE"
|
||||
}
|
||||
],
|
||||
"Constraints": null,
|
||||
"Triggers": []
|
||||
},
|
||||
{
|
||||
@ -926,19 +780,6 @@
|
||||
"GenerationExpression": "",
|
||||
"Comment": "The identifier of the segment that terminates the name of this symbol. See the table [`codeintel_scip_symbol_names`](#table-publiccodeintel_scip_symbol_names) on how to reconstruct the full symbol name."
|
||||
},
|
||||
{
|
||||
"Name": "tenant_id",
|
||||
"Index": 10,
|
||||
"TypeName": "integer",
|
||||
"IsNullable": true,
|
||||
"Default": "",
|
||||
"CharacterMaximumLength": 0,
|
||||
"IsIdentity": false,
|
||||
"IdentityGeneration": "",
|
||||
"IsGenerated": "NEVER",
|
||||
"GenerationExpression": "",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Name": "type_definition_ranges",
|
||||
"Index": 8,
|
||||
@ -995,13 +836,6 @@
|
||||
"RefTableName": "codeintel_scip_document_lookup",
|
||||
"IsDeferrable": false,
|
||||
"ConstraintDefinition": "FOREIGN KEY (document_lookup_id) REFERENCES codeintel_scip_document_lookup(id) ON DELETE CASCADE"
|
||||
},
|
||||
{
|
||||
"Name": "codeintel_scip_symbols_tenant_id_fkey",
|
||||
"ConstraintType": "f",
|
||||
"RefTableName": "tenants",
|
||||
"IsDeferrable": false,
|
||||
"ConstraintDefinition": "FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE"
|
||||
}
|
||||
],
|
||||
"Triggers": [
|
||||
@ -1041,19 +875,6 @@
|
||||
"GenerationExpression": "",
|
||||
"Comment": "A lower-bound on the `schema_version` values of the records in the table [`codeintel_scip_symbols`](#table-publiccodeintel_scip_symbols) where the `upload_id` column matches the associated SCIP index."
|
||||
},
|
||||
{
|
||||
"Name": "tenant_id",
|
||||
"Index": 4,
|
||||
"TypeName": "integer",
|
||||
"IsNullable": true,
|
||||
"Default": "",
|
||||
"CharacterMaximumLength": 0,
|
||||
"IsIdentity": false,
|
||||
"IdentityGeneration": "",
|
||||
"IsGenerated": "NEVER",
|
||||
"GenerationExpression": "",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Name": "upload_id",
|
||||
"Index": 1,
|
||||
@ -1080,15 +901,7 @@
|
||||
"ConstraintDefinition": "PRIMARY KEY (upload_id)"
|
||||
}
|
||||
],
|
||||
"Constraints": [
|
||||
{
|
||||
"Name": "codeintel_scip_symbols_schema_versions_tenant_id_fkey",
|
||||
"ConstraintType": "f",
|
||||
"RefTableName": "tenants",
|
||||
"IsDeferrable": false,
|
||||
"ConstraintDefinition": "FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE"
|
||||
}
|
||||
],
|
||||
"Constraints": null,
|
||||
"Triggers": []
|
||||
},
|
||||
{
|
||||
@ -1309,19 +1122,6 @@
|
||||
"IsGenerated": "NEVER",
|
||||
"GenerationExpression": "",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Name": "tenant_id",
|
||||
"Index": 6,
|
||||
"TypeName": "integer",
|
||||
"IsNullable": true,
|
||||
"Default": "",
|
||||
"CharacterMaximumLength": 0,
|
||||
"IsIdentity": false,
|
||||
"IdentityGeneration": "",
|
||||
"IsGenerated": "NEVER",
|
||||
"GenerationExpression": "",
|
||||
"Comment": ""
|
||||
}
|
||||
],
|
||||
"Indexes": [
|
||||
@ -1356,15 +1156,7 @@
|
||||
"ConstraintDefinition": ""
|
||||
}
|
||||
],
|
||||
"Constraints": [
|
||||
{
|
||||
"Name": "rockskip_ancestry_tenant_id_fkey",
|
||||
"ConstraintType": "f",
|
||||
"RefTableName": "tenants",
|
||||
"IsDeferrable": false,
|
||||
"ConstraintDefinition": "FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE"
|
||||
}
|
||||
],
|
||||
"Constraints": null,
|
||||
"Triggers": []
|
||||
},
|
||||
{
|
||||
@ -1409,19 +1201,6 @@
|
||||
"IsGenerated": "NEVER",
|
||||
"GenerationExpression": "",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Name": "tenant_id",
|
||||
"Index": 4,
|
||||
"TypeName": "integer",
|
||||
"IsNullable": true,
|
||||
"Default": "",
|
||||
"CharacterMaximumLength": 0,
|
||||
"IsIdentity": false,
|
||||
"IdentityGeneration": "",
|
||||
"IsGenerated": "NEVER",
|
||||
"GenerationExpression": "",
|
||||
"Comment": ""
|
||||
}
|
||||
],
|
||||
"Indexes": [
|
||||
@ -1466,15 +1245,7 @@
|
||||
"ConstraintDefinition": ""
|
||||
}
|
||||
],
|
||||
"Constraints": [
|
||||
{
|
||||
"Name": "rockskip_repos_tenant_id_fkey",
|
||||
"ConstraintType": "f",
|
||||
"RefTableName": "tenants",
|
||||
"IsDeferrable": false,
|
||||
"ConstraintDefinition": "FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE"
|
||||
}
|
||||
],
|
||||
"Constraints": null,
|
||||
"Triggers": []
|
||||
},
|
||||
{
|
||||
@ -1558,19 +1329,6 @@
|
||||
"IsGenerated": "NEVER",
|
||||
"GenerationExpression": "",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Name": "tenant_id",
|
||||
"Index": 7,
|
||||
"TypeName": "integer",
|
||||
"IsNullable": true,
|
||||
"Default": "",
|
||||
"CharacterMaximumLength": 0,
|
||||
"IsIdentity": false,
|
||||
"IdentityGeneration": "",
|
||||
"IsGenerated": "NEVER",
|
||||
"GenerationExpression": "",
|
||||
"Comment": ""
|
||||
}
|
||||
],
|
||||
"Indexes": [
|
||||
@ -1605,15 +1363,7 @@
|
||||
"ConstraintDefinition": ""
|
||||
}
|
||||
],
|
||||
"Constraints": [
|
||||
{
|
||||
"Name": "rockskip_symbols_tenant_id_fkey",
|
||||
"ConstraintType": "f",
|
||||
"RefTableName": "tenants",
|
||||
"IsDeferrable": false,
|
||||
"ConstraintDefinition": "FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE"
|
||||
}
|
||||
],
|
||||
"Constraints": null,
|
||||
"Triggers": []
|
||||
},
|
||||
{
|
||||
|
||||
@ -4,12 +4,9 @@
|
||||
-------------------+--------------------------+-----------+----------+---------
|
||||
dump_id | integer | | not null |
|
||||
last_reconcile_at | timestamp with time zone | | not null |
|
||||
tenant_id | integer | | |
|
||||
Indexes:
|
||||
"codeintel_last_reconcile_dump_id_key" UNIQUE CONSTRAINT, btree (dump_id)
|
||||
"codeintel_last_reconcile_last_reconcile_at_dump_id" btree (last_reconcile_at, dump_id)
|
||||
Foreign-key constraints:
|
||||
"codeintel_last_reconcile_tenant_id_fkey" FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
|
||||
```
|
||||
|
||||
@ -23,14 +20,12 @@ Stores the last time processed LSIF data was reconciled with the other database.
|
||||
upload_id | integer | | not null |
|
||||
document_path | text | | not null |
|
||||
document_id | bigint | | not null |
|
||||
tenant_id | integer | | |
|
||||
Indexes:
|
||||
"codeintel_scip_document_lookup_pkey" PRIMARY KEY, btree (id)
|
||||
"codeintel_scip_document_lookup_upload_id_document_path_key" UNIQUE CONSTRAINT, btree (upload_id, document_path)
|
||||
"codeintel_scip_document_lookup_document_id" hash (document_id)
|
||||
Foreign-key constraints:
|
||||
"codeintel_scip_document_lookup_document_id_fk" FOREIGN KEY (document_id) REFERENCES codeintel_scip_documents(id)
|
||||
"codeintel_scip_document_lookup_tenant_id_fkey" FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
Referenced by:
|
||||
TABLE "codeintel_scip_symbols" CONSTRAINT "codeintel_scip_symbols_document_lookup_id_fk" FOREIGN KEY (document_lookup_id) REFERENCES codeintel_scip_document_lookup(id) ON DELETE CASCADE
|
||||
Triggers:
|
||||
@ -56,11 +51,8 @@ A mapping from file paths to document references within a particular SCIP index.
|
||||
upload_id | integer | | not null |
|
||||
min_schema_version | integer | | |
|
||||
max_schema_version | integer | | |
|
||||
tenant_id | integer | | |
|
||||
Indexes:
|
||||
"codeintel_scip_document_lookup_schema_versions_pkey" PRIMARY KEY, btree (upload_id)
|
||||
Foreign-key constraints:
|
||||
"codeintel_scip_document_lookup_schema_versions_tenant_id_fkey" FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
|
||||
```
|
||||
|
||||
@ -80,12 +72,9 @@ Tracks the range of `schema_versions` values associated with each SCIP index in
|
||||
payload_hash | bytea | | not null |
|
||||
schema_version | integer | | not null |
|
||||
raw_scip_payload | bytea | | not null |
|
||||
tenant_id | integer | | |
|
||||
Indexes:
|
||||
"codeintel_scip_documents_pkey" PRIMARY KEY, btree (id)
|
||||
"codeintel_scip_documents_payload_hash_key" UNIQUE CONSTRAINT, btree (payload_hash)
|
||||
Foreign-key constraints:
|
||||
"codeintel_scip_documents_tenant_id_fkey" FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
Referenced by:
|
||||
TABLE "codeintel_scip_document_lookup" CONSTRAINT "codeintel_scip_document_lookup_document_id_fk" FOREIGN KEY (document_id) REFERENCES codeintel_scip_documents(id)
|
||||
|
||||
@ -108,12 +97,9 @@ A lookup of SCIP [Document](https://sourcegraph.com/search?q=context:%40sourcegr
|
||||
id | bigint | | not null | nextval('codeintel_scip_documents_dereference_logs_id_seq'::regclass)
|
||||
document_id | bigint | | not null |
|
||||
last_removal_time | timestamp with time zone | | not null | now()
|
||||
tenant_id | integer | | |
|
||||
Indexes:
|
||||
"codeintel_scip_documents_dereference_logs_pkey" PRIMARY KEY, btree (id)
|
||||
"codeintel_scip_documents_dereference_logs_last_removal_time_des" btree (last_removal_time DESC, document_id)
|
||||
Foreign-key constraints:
|
||||
"codeintel_scip_documents_dereference_logs_tenant_id_fkey" FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
|
||||
```
|
||||
|
||||
@ -134,12 +120,9 @@ A list of document rows that were recently dereferenced by the deletion of an in
|
||||
tool_arguments | text[] | | not null |
|
||||
text_document_encoding | text | | not null |
|
||||
protocol_version | integer | | not null |
|
||||
tenant_id | integer | | |
|
||||
Indexes:
|
||||
"codeintel_scip_metadata_pkey" PRIMARY KEY, btree (id)
|
||||
"codeintel_scip_metadata_upload_id" btree (upload_id)
|
||||
Foreign-key constraints:
|
||||
"codeintel_scip_metadata_tenant_id_fkey" FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
|
||||
```
|
||||
|
||||
@ -167,13 +150,10 @@ Global metadatadata about a single processed upload.
|
||||
upload_id | integer | | not null |
|
||||
name_segment | text | | not null |
|
||||
prefix_id | integer | | |
|
||||
tenant_id | integer | | |
|
||||
Indexes:
|
||||
"codeintel_scip_symbol_names_pkey" PRIMARY KEY, btree (upload_id, id)
|
||||
"codeintel_scip_symbol_names_upload_id_roots" btree (upload_id) WHERE prefix_id IS NULL
|
||||
"codeisdntel_scip_symbol_names_upload_id_children" btree (upload_id, prefix_id) WHERE prefix_id IS NOT NULL
|
||||
Foreign-key constraints:
|
||||
"codeintel_scip_symbol_names_tenant_id_fkey" FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
|
||||
```
|
||||
|
||||
@ -199,13 +179,11 @@ Stores a prefix tree of symbol names within a particular upload.
|
||||
implementation_ranges | bytea | | |
|
||||
type_definition_ranges | bytea | | |
|
||||
symbol_id | integer | | not null |
|
||||
tenant_id | integer | | |
|
||||
Indexes:
|
||||
"codeintel_scip_symbols_pkey" PRIMARY KEY, btree (upload_id, symbol_id, document_lookup_id)
|
||||
"codeintel_scip_symbols_document_lookup_id" btree (document_lookup_id)
|
||||
Foreign-key constraints:
|
||||
"codeintel_scip_symbols_document_lookup_id_fk" FOREIGN KEY (document_lookup_id) REFERENCES codeintel_scip_document_lookup(id) ON DELETE CASCADE
|
||||
"codeintel_scip_symbols_tenant_id_fkey" FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
Triggers:
|
||||
codeintel_scip_symbols_schema_versions_insert AFTER INSERT ON codeintel_scip_symbols REFERENCING NEW TABLE AS newtab FOR EACH STATEMENT EXECUTE FUNCTION update_codeintel_scip_symbols_schema_versions_insert()
|
||||
|
||||
@ -236,11 +214,8 @@ A mapping from SCIP [Symbol names](https://sourcegraph.com/search?q=context:%40s
|
||||
upload_id | integer | | not null |
|
||||
min_schema_version | integer | | |
|
||||
max_schema_version | integer | | |
|
||||
tenant_id | integer | | |
|
||||
Indexes:
|
||||
"codeintel_scip_symbols_schema_versions_pkey" PRIMARY KEY, btree (upload_id)
|
||||
Foreign-key constraints:
|
||||
"codeintel_scip_symbols_schema_versions_tenant_id_fkey" FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
|
||||
```
|
||||
|
||||
@ -280,13 +255,10 @@ Indexes:
|
||||
commit_id | character varying(40) | | not null |
|
||||
height | integer | | not null |
|
||||
ancestor | integer | | not null |
|
||||
tenant_id | integer | | |
|
||||
Indexes:
|
||||
"rockskip_ancestry_pkey" PRIMARY KEY, btree (id)
|
||||
"rockskip_ancestry_repo_id_commit_id_key" UNIQUE CONSTRAINT, btree (repo_id, commit_id)
|
||||
"rockskip_ancestry_repo_commit_id" btree (repo_id, commit_id)
|
||||
Foreign-key constraints:
|
||||
"rockskip_ancestry_tenant_id_fkey" FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
|
||||
```
|
||||
|
||||
@ -297,34 +269,28 @@ Foreign-key constraints:
|
||||
id | integer | | not null | nextval('rockskip_repos_id_seq'::regclass)
|
||||
repo | text | | not null |
|
||||
last_accessed_at | timestamp with time zone | | not null |
|
||||
tenant_id | integer | | |
|
||||
Indexes:
|
||||
"rockskip_repos_pkey" PRIMARY KEY, btree (id)
|
||||
"rockskip_repos_repo_key" UNIQUE CONSTRAINT, btree (repo)
|
||||
"rockskip_repos_last_accessed_at" btree (last_accessed_at)
|
||||
"rockskip_repos_repo" btree (repo)
|
||||
Foreign-key constraints:
|
||||
"rockskip_repos_tenant_id_fkey" FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
|
||||
```
|
||||
|
||||
# Table "public.rockskip_symbols"
|
||||
```
|
||||
Column | Type | Collation | Nullable | Default
|
||||
-----------+-----------+-----------+----------+----------------------------------------------
|
||||
id | integer | | not null | nextval('rockskip_symbols_id_seq'::regclass)
|
||||
added | integer[] | | not null |
|
||||
deleted | integer[] | | not null |
|
||||
repo_id | integer | | not null |
|
||||
path | text | | not null |
|
||||
name | text | | not null |
|
||||
tenant_id | integer | | |
|
||||
Column | Type | Collation | Nullable | Default
|
||||
---------+-----------+-----------+----------+----------------------------------------------
|
||||
id | integer | | not null | nextval('rockskip_symbols_id_seq'::regclass)
|
||||
added | integer[] | | not null |
|
||||
deleted | integer[] | | not null |
|
||||
repo_id | integer | | not null |
|
||||
path | text | | not null |
|
||||
name | text | | not null |
|
||||
Indexes:
|
||||
"rockskip_symbols_pkey" PRIMARY KEY, btree (id)
|
||||
"rockskip_symbols_gin" gin (singleton_integer(repo_id) gin__int_ops, added gin__int_ops, deleted gin__int_ops, name gin_trgm_ops, singleton(name), singleton(lower(name)), path gin_trgm_ops, singleton(path), path_prefixes(path), singleton(lower(path)), path_prefixes(lower(path)), singleton(get_file_extension(path)), singleton(get_file_extension(lower(path))))
|
||||
"rockskip_symbols_repo_id_path_name" btree (repo_id, path, name)
|
||||
Foreign-key constraints:
|
||||
"rockskip_symbols_tenant_id_fkey" FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
|
||||
```
|
||||
|
||||
@ -342,19 +308,6 @@ Indexes:
|
||||
Check constraints:
|
||||
"tenant_name_length" CHECK (char_length(name) <= 32 AND char_length(name) >= 3)
|
||||
"tenant_name_valid_chars" CHECK (name ~ '^[a-z](?:[a-z0-9\_-])*[a-z0-9]$'::text)
|
||||
Referenced by:
|
||||
TABLE "codeintel_last_reconcile" CONSTRAINT "codeintel_last_reconcile_tenant_id_fkey" FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
TABLE "codeintel_scip_document_lookup_schema_versions" CONSTRAINT "codeintel_scip_document_lookup_schema_versions_tenant_id_fkey" FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
TABLE "codeintel_scip_document_lookup" CONSTRAINT "codeintel_scip_document_lookup_tenant_id_fkey" FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
TABLE "codeintel_scip_documents_dereference_logs" CONSTRAINT "codeintel_scip_documents_dereference_logs_tenant_id_fkey" FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
TABLE "codeintel_scip_documents" CONSTRAINT "codeintel_scip_documents_tenant_id_fkey" FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
TABLE "codeintel_scip_metadata" CONSTRAINT "codeintel_scip_metadata_tenant_id_fkey" FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
TABLE "codeintel_scip_symbol_names" CONSTRAINT "codeintel_scip_symbol_names_tenant_id_fkey" FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
TABLE "codeintel_scip_symbols_schema_versions" CONSTRAINT "codeintel_scip_symbols_schema_versions_tenant_id_fkey" FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
TABLE "codeintel_scip_symbols" CONSTRAINT "codeintel_scip_symbols_tenant_id_fkey" FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
TABLE "rockskip_ancestry" CONSTRAINT "rockskip_ancestry_tenant_id_fkey" FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
TABLE "rockskip_repos" CONSTRAINT "rockskip_repos_tenant_id_fkey" FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
TABLE "rockskip_symbols" CONSTRAINT "rockskip_symbols_tenant_id_fkey" FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
|
||||
```
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -417,7 +417,7 @@ WHERE div.dashboard_id = %s AND iv.unique_id = %s
|
||||
`
|
||||
|
||||
const getDashboardGrantsSql = `
|
||||
SELECT id, dashboard_id, user_id, org_id, global FROM dashboard_grants where dashboard_id = %s
|
||||
SELECT * FROM dashboard_grants where dashboard_id = %s
|
||||
`
|
||||
|
||||
const getDashboardGrantsByPermissionsSql = `
|
||||
|
||||
@ -1,30 +0,0 @@
|
||||
-- Temporary function to deduplicate the logic required for each table:
|
||||
CREATE OR REPLACE FUNCTION migrate_table(table_name text)
|
||||
RETURNS void AS $$
|
||||
BEGIN
|
||||
EXECUTE format('ALTER TABLE %I DROP COLUMN IF EXISTS tenant_id;', table_name);
|
||||
END;
|
||||
$$ LANGUAGE plpgsql;
|
||||
|
||||
SELECT migrate_table('archived_insight_series_recording_times');
|
||||
SELECT migrate_table('archived_series_points');
|
||||
SELECT migrate_table('dashboard');
|
||||
SELECT migrate_table('dashboard_grants');
|
||||
SELECT migrate_table('dashboard_insight_view');
|
||||
SELECT migrate_table('insight_series');
|
||||
SELECT migrate_table('insight_series_backfill');
|
||||
SELECT migrate_table('insight_series_incomplete_points');
|
||||
SELECT migrate_table('insight_series_recording_times');
|
||||
SELECT migrate_table('insight_view');
|
||||
SELECT migrate_table('insight_view_grants');
|
||||
SELECT migrate_table('insight_view_series');
|
||||
SELECT migrate_table('insights_background_jobs');
|
||||
SELECT migrate_table('insights_data_retention_jobs');
|
||||
SELECT migrate_table('metadata');
|
||||
SELECT migrate_table('repo_iterator');
|
||||
SELECT migrate_table('repo_iterator_errors');
|
||||
SELECT migrate_table('repo_names');
|
||||
SELECT migrate_table('series_points');
|
||||
SELECT migrate_table('series_points_snapshots');
|
||||
|
||||
DROP FUNCTION migrate_table(text);
|
||||
@ -1,2 +0,0 @@
|
||||
name: add tenant id to most tables
|
||||
parents: [1719914228]
|
||||
@ -1,37 +0,0 @@
|
||||
-- This migration adds the tenant_id column in a way which doesn't require
|
||||
-- updating every row. The value is null and an out of band migration will set
|
||||
-- it to the default. A later migration will enforce tenant_id to be set.
|
||||
|
||||
-- Temporary function to deduplicate the logic required for each table:
|
||||
CREATE OR REPLACE FUNCTION migrate_table(table_name text)
|
||||
RETURNS void AS $$
|
||||
BEGIN
|
||||
EXECUTE format('ALTER TABLE %I ADD COLUMN IF NOT EXISTS tenant_id integer REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE;', table_name);
|
||||
END;
|
||||
$$ LANGUAGE plpgsql;
|
||||
|
||||
SELECT migrate_table('archived_insight_series_recording_times');
|
||||
SELECT migrate_table('archived_series_points');
|
||||
SELECT migrate_table('dashboard');
|
||||
SELECT migrate_table('dashboard_grants');
|
||||
SELECT migrate_table('dashboard_insight_view');
|
||||
SELECT migrate_table('insight_series');
|
||||
SELECT migrate_table('insight_series_backfill');
|
||||
SELECT migrate_table('insight_series_incomplete_points');
|
||||
SELECT migrate_table('insight_series_recording_times');
|
||||
SELECT migrate_table('insight_view');
|
||||
SELECT migrate_table('insight_view_grants');
|
||||
SELECT migrate_table('insight_view_series');
|
||||
SELECT migrate_table('insights_background_jobs');
|
||||
SELECT migrate_table('insights_data_retention_jobs');
|
||||
SELECT migrate_table('metadata');
|
||||
SELECT migrate_table('repo_iterator');
|
||||
SELECT migrate_table('repo_iterator_errors');
|
||||
SELECT migrate_table('repo_names');
|
||||
SELECT migrate_table('series_points');
|
||||
SELECT migrate_table('series_points_snapshots');
|
||||
|
||||
-- Explicitly excluded tables
|
||||
-- migration_logs :: about DB
|
||||
|
||||
DROP FUNCTION migrate_table(text);
|
||||
@ -33,8 +33,7 @@ CREATE TYPE time_unit AS ENUM (
|
||||
CREATE TABLE archived_insight_series_recording_times (
|
||||
insight_series_id integer NOT NULL,
|
||||
recording_time timestamp with time zone NOT NULL,
|
||||
snapshot boolean NOT NULL,
|
||||
tenant_id integer
|
||||
snapshot boolean NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE archived_series_points (
|
||||
@ -45,7 +44,6 @@ CREATE TABLE archived_series_points (
|
||||
repo_name_id integer,
|
||||
original_repo_name_id integer,
|
||||
capture text,
|
||||
tenant_id integer,
|
||||
CONSTRAINT check_repo_fields_specifity CHECK ((((repo_id IS NULL) AND (repo_name_id IS NULL) AND (original_repo_name_id IS NULL)) OR ((repo_id IS NOT NULL) AND (repo_name_id IS NOT NULL) AND (original_repo_name_id IS NOT NULL))))
|
||||
);
|
||||
|
||||
@ -57,8 +55,7 @@ CREATE TABLE dashboard (
|
||||
last_updated_at timestamp without time zone DEFAULT now() NOT NULL,
|
||||
deleted_at timestamp without time zone,
|
||||
save boolean DEFAULT false NOT NULL,
|
||||
type text DEFAULT 'standard'::text NOT NULL,
|
||||
tenant_id integer
|
||||
type text DEFAULT 'standard'::text NOT NULL
|
||||
);
|
||||
|
||||
COMMENT ON TABLE dashboard IS 'Metadata for dashboards of insights';
|
||||
@ -80,8 +77,7 @@ CREATE TABLE dashboard_grants (
|
||||
dashboard_id integer NOT NULL,
|
||||
user_id integer,
|
||||
org_id integer,
|
||||
global boolean,
|
||||
tenant_id integer
|
||||
global boolean
|
||||
);
|
||||
|
||||
COMMENT ON TABLE dashboard_grants IS 'Permission grants for dashboards. Each row should represent a unique principal (user, org, etc).';
|
||||
@ -115,8 +111,7 @@ ALTER SEQUENCE dashboard_id_seq OWNED BY dashboard.id;
|
||||
CREATE TABLE dashboard_insight_view (
|
||||
id integer NOT NULL,
|
||||
dashboard_id integer NOT NULL,
|
||||
insight_view_id integer NOT NULL,
|
||||
tenant_id integer
|
||||
insight_view_id integer NOT NULL
|
||||
);
|
||||
|
||||
CREATE SEQUENCE dashboard_insight_view_id_seq
|
||||
@ -153,8 +148,7 @@ CREATE TABLE insight_series (
|
||||
backfill_completed_at timestamp without time zone,
|
||||
supports_augmentation boolean DEFAULT true NOT NULL,
|
||||
repository_criteria text,
|
||||
query_old text,
|
||||
tenant_id integer
|
||||
query_old text
|
||||
);
|
||||
|
||||
COMMENT ON TABLE insight_series IS 'Data series that comprise code insights.';
|
||||
@ -188,8 +182,7 @@ CREATE TABLE insight_series_backfill (
|
||||
series_id integer NOT NULL,
|
||||
repo_iterator_id integer,
|
||||
estimated_cost double precision,
|
||||
state text DEFAULT 'new'::text NOT NULL,
|
||||
tenant_id integer
|
||||
state text DEFAULT 'new'::text NOT NULL
|
||||
);
|
||||
|
||||
CREATE SEQUENCE insight_series_backfill_id_seq
|
||||
@ -217,8 +210,7 @@ CREATE TABLE insight_series_incomplete_points (
|
||||
series_id integer NOT NULL,
|
||||
reason text NOT NULL,
|
||||
"time" timestamp without time zone NOT NULL,
|
||||
repo_id integer,
|
||||
tenant_id integer
|
||||
repo_id integer
|
||||
);
|
||||
|
||||
CREATE SEQUENCE insight_series_incomplete_points_id_seq
|
||||
@ -234,8 +226,7 @@ ALTER SEQUENCE insight_series_incomplete_points_id_seq OWNED BY insight_series_i
|
||||
CREATE TABLE insight_series_recording_times (
|
||||
insight_series_id integer,
|
||||
recording_time timestamp with time zone,
|
||||
snapshot boolean,
|
||||
tenant_id integer
|
||||
snapshot boolean
|
||||
);
|
||||
|
||||
CREATE TABLE insight_view (
|
||||
@ -252,8 +243,7 @@ CREATE TABLE insight_view (
|
||||
series_sort_mode series_sort_mode_enum,
|
||||
series_sort_direction series_sort_direction_enum,
|
||||
series_limit integer,
|
||||
series_num_samples integer,
|
||||
tenant_id integer
|
||||
series_num_samples integer
|
||||
);
|
||||
|
||||
COMMENT ON TABLE insight_view IS 'Views for insight data series. An insight view is an abstraction on top of an insight data series that allows for lightweight modifications to filters or metadata without regenerating the underlying series.';
|
||||
@ -275,8 +265,7 @@ CREATE TABLE insight_view_grants (
|
||||
insight_view_id integer NOT NULL,
|
||||
user_id integer,
|
||||
org_id integer,
|
||||
global boolean,
|
||||
tenant_id integer
|
||||
global boolean
|
||||
);
|
||||
|
||||
COMMENT ON TABLE insight_view_grants IS 'Permission grants for insight views. Each row should represent a unique principal (user, org, etc).';
|
||||
@ -311,8 +300,7 @@ CREATE TABLE insight_view_series (
|
||||
insight_view_id integer NOT NULL,
|
||||
insight_series_id integer NOT NULL,
|
||||
label text,
|
||||
stroke text,
|
||||
tenant_id integer
|
||||
stroke text
|
||||
);
|
||||
|
||||
COMMENT ON TABLE insight_view_series IS 'Join table to correlate data series with insight views';
|
||||
@ -339,8 +327,7 @@ CREATE TABLE insights_background_jobs (
|
||||
execution_logs json[],
|
||||
worker_hostname text DEFAULT ''::text NOT NULL,
|
||||
cancel boolean DEFAULT false NOT NULL,
|
||||
backfill_id integer,
|
||||
tenant_id integer
|
||||
backfill_id integer
|
||||
);
|
||||
|
||||
CREATE SEQUENCE insights_background_jobs_id_seq
|
||||
@ -368,8 +355,7 @@ CREATE TABLE insights_data_retention_jobs (
|
||||
worker_hostname text DEFAULT ''::text NOT NULL,
|
||||
cancel boolean DEFAULT false NOT NULL,
|
||||
series_id integer NOT NULL,
|
||||
series_id_string text DEFAULT ''::text NOT NULL,
|
||||
tenant_id integer
|
||||
series_id_string text DEFAULT ''::text NOT NULL
|
||||
);
|
||||
|
||||
CREATE SEQUENCE insights_data_retention_jobs_id_seq
|
||||
@ -427,8 +413,7 @@ CREATE VIEW insights_jobs_backfill_new AS
|
||||
|
||||
CREATE TABLE metadata (
|
||||
id bigint NOT NULL,
|
||||
metadata jsonb NOT NULL,
|
||||
tenant_id integer
|
||||
metadata jsonb NOT NULL
|
||||
);
|
||||
|
||||
COMMENT ON TABLE metadata IS 'Records arbitrary metadata about events. Stored in a separate table as it is often repeated for multiple events.';
|
||||
@ -457,8 +442,7 @@ CREATE TABLE repo_iterator (
|
||||
total_count integer DEFAULT 0 NOT NULL,
|
||||
success_count integer DEFAULT 0 NOT NULL,
|
||||
repos integer[],
|
||||
repo_cursor integer DEFAULT 0,
|
||||
tenant_id integer
|
||||
repo_cursor integer DEFAULT 0
|
||||
);
|
||||
|
||||
CREATE TABLE repo_iterator_errors (
|
||||
@ -466,8 +450,7 @@ CREATE TABLE repo_iterator_errors (
|
||||
repo_iterator_id integer NOT NULL,
|
||||
repo_id integer NOT NULL,
|
||||
error_message text[] NOT NULL,
|
||||
failure_count integer DEFAULT 1,
|
||||
tenant_id integer
|
||||
failure_count integer DEFAULT 1
|
||||
);
|
||||
|
||||
CREATE SEQUENCE repo_iterator_errors_id_seq
|
||||
@ -493,7 +476,6 @@ ALTER SEQUENCE repo_iterator_id_seq OWNED BY repo_iterator.id;
|
||||
CREATE TABLE repo_names (
|
||||
id bigint NOT NULL,
|
||||
name citext NOT NULL,
|
||||
tenant_id integer,
|
||||
CONSTRAINT check_name_nonempty CHECK ((name OPERATOR(<>) ''::citext))
|
||||
);
|
||||
|
||||
@ -521,7 +503,6 @@ CREATE TABLE series_points (
|
||||
repo_name_id integer,
|
||||
original_repo_name_id integer,
|
||||
capture text,
|
||||
tenant_id integer,
|
||||
CONSTRAINT check_repo_fields_specifity CHECK ((((repo_id IS NULL) AND (repo_name_id IS NULL) AND (original_repo_name_id IS NULL)) OR ((repo_id IS NOT NULL) AND (repo_name_id IS NOT NULL) AND (original_repo_name_id IS NOT NULL))))
|
||||
);
|
||||
|
||||
@ -550,7 +531,6 @@ CREATE TABLE series_points_snapshots (
|
||||
repo_name_id integer,
|
||||
original_repo_name_id integer,
|
||||
capture text,
|
||||
tenant_id integer,
|
||||
CONSTRAINT check_repo_fields_specifity CHECK ((((repo_id IS NULL) AND (repo_name_id IS NULL) AND (original_repo_name_id IS NULL)) OR ((repo_id IS NOT NULL) AND (repo_name_id IS NOT NULL) AND (original_repo_name_id IS NOT NULL))))
|
||||
);
|
||||
|
||||
@ -721,36 +701,18 @@ CREATE INDEX series_points_snapshots_series_id_idx ON series_points_snapshots US
|
||||
|
||||
CREATE INDEX series_points_snapshots_series_id_repo_id_time_idx ON series_points_snapshots USING btree (series_id, repo_id, "time");
|
||||
|
||||
ALTER TABLE ONLY archived_insight_series_recording_times
|
||||
ADD CONSTRAINT archived_insight_series_recording_times_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE;
|
||||
|
||||
ALTER TABLE ONLY archived_series_points
|
||||
ADD CONSTRAINT archived_series_points_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE;
|
||||
|
||||
ALTER TABLE ONLY dashboard_grants
|
||||
ADD CONSTRAINT dashboard_grants_dashboard_id_fk FOREIGN KEY (dashboard_id) REFERENCES dashboard(id) ON DELETE CASCADE;
|
||||
|
||||
ALTER TABLE ONLY dashboard_grants
|
||||
ADD CONSTRAINT dashboard_grants_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE;
|
||||
|
||||
ALTER TABLE ONLY dashboard_insight_view
|
||||
ADD CONSTRAINT dashboard_insight_view_dashboard_id_fk FOREIGN KEY (dashboard_id) REFERENCES dashboard(id) ON DELETE CASCADE;
|
||||
|
||||
ALTER TABLE ONLY dashboard_insight_view
|
||||
ADD CONSTRAINT dashboard_insight_view_insight_view_id_fk FOREIGN KEY (insight_view_id) REFERENCES insight_view(id) ON DELETE CASCADE;
|
||||
|
||||
ALTER TABLE ONLY dashboard_insight_view
|
||||
ADD CONSTRAINT dashboard_insight_view_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE;
|
||||
|
||||
ALTER TABLE ONLY dashboard
|
||||
ADD CONSTRAINT dashboard_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE;
|
||||
|
||||
ALTER TABLE ONLY insight_series_backfill
|
||||
ADD CONSTRAINT insight_series_backfill_series_id_fk FOREIGN KEY (series_id) REFERENCES insight_series(id) ON DELETE CASCADE;
|
||||
|
||||
ALTER TABLE ONLY insight_series_backfill
|
||||
ADD CONSTRAINT insight_series_backfill_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE;
|
||||
|
||||
ALTER TABLE ONLY insight_series_recording_times
|
||||
ADD CONSTRAINT insight_series_id_fkey FOREIGN KEY (insight_series_id) REFERENCES insight_series(id) ON DELETE CASCADE;
|
||||
|
||||
@ -760,60 +722,24 @@ ALTER TABLE ONLY archived_insight_series_recording_times
|
||||
ALTER TABLE ONLY insight_series_incomplete_points
|
||||
ADD CONSTRAINT insight_series_incomplete_points_series_id_fk FOREIGN KEY (series_id) REFERENCES insight_series(id) ON DELETE CASCADE;
|
||||
|
||||
ALTER TABLE ONLY insight_series_incomplete_points
|
||||
ADD CONSTRAINT insight_series_incomplete_points_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE;
|
||||
|
||||
ALTER TABLE ONLY insight_series_recording_times
|
||||
ADD CONSTRAINT insight_series_recording_times_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE;
|
||||
|
||||
ALTER TABLE ONLY archived_series_points
|
||||
ADD CONSTRAINT insight_series_series_id_fkey FOREIGN KEY (series_id) REFERENCES insight_series(series_id) ON DELETE CASCADE;
|
||||
|
||||
ALTER TABLE ONLY insight_series
|
||||
ADD CONSTRAINT insight_series_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE;
|
||||
|
||||
ALTER TABLE ONLY insight_view_grants
|
||||
ADD CONSTRAINT insight_view_grants_insight_view_id_fk FOREIGN KEY (insight_view_id) REFERENCES insight_view(id) ON DELETE CASCADE;
|
||||
|
||||
ALTER TABLE ONLY insight_view_grants
|
||||
ADD CONSTRAINT insight_view_grants_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE;
|
||||
|
||||
ALTER TABLE ONLY insight_view_series
|
||||
ADD CONSTRAINT insight_view_series_insight_series_id_fkey FOREIGN KEY (insight_series_id) REFERENCES insight_series(id);
|
||||
|
||||
ALTER TABLE ONLY insight_view_series
|
||||
ADD CONSTRAINT insight_view_series_insight_view_id_fkey FOREIGN KEY (insight_view_id) REFERENCES insight_view(id) ON DELETE CASCADE;
|
||||
|
||||
ALTER TABLE ONLY insight_view_series
|
||||
ADD CONSTRAINT insight_view_series_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE;
|
||||
|
||||
ALTER TABLE ONLY insight_view
|
||||
ADD CONSTRAINT insight_view_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE;
|
||||
|
||||
ALTER TABLE ONLY insights_background_jobs
|
||||
ADD CONSTRAINT insights_background_jobs_backfill_id_fkey FOREIGN KEY (backfill_id) REFERENCES insight_series_backfill(id) ON DELETE CASCADE;
|
||||
|
||||
ALTER TABLE ONLY insights_background_jobs
|
||||
ADD CONSTRAINT insights_background_jobs_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE;
|
||||
|
||||
ALTER TABLE ONLY insights_data_retention_jobs
|
||||
ADD CONSTRAINT insights_data_retention_jobs_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE;
|
||||
|
||||
ALTER TABLE ONLY metadata
|
||||
ADD CONSTRAINT metadata_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE;
|
||||
|
||||
ALTER TABLE ONLY repo_iterator_errors
|
||||
ADD CONSTRAINT repo_iterator_errors_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE;
|
||||
|
||||
ALTER TABLE ONLY repo_iterator_errors
|
||||
ADD CONSTRAINT repo_iterator_fk FOREIGN KEY (repo_iterator_id) REFERENCES repo_iterator(id);
|
||||
|
||||
ALTER TABLE ONLY repo_iterator
|
||||
ADD CONSTRAINT repo_iterator_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE;
|
||||
|
||||
ALTER TABLE ONLY repo_names
|
||||
ADD CONSTRAINT repo_names_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE;
|
||||
|
||||
ALTER TABLE ONLY series_points
|
||||
ADD CONSTRAINT series_points_metadata_id_fkey FOREIGN KEY (metadata_id) REFERENCES metadata(id) ON DELETE CASCADE DEFERRABLE;
|
||||
|
||||
@ -821,10 +747,4 @@ ALTER TABLE ONLY series_points
|
||||
ADD CONSTRAINT series_points_original_repo_name_id_fkey FOREIGN KEY (original_repo_name_id) REFERENCES repo_names(id) ON DELETE CASCADE DEFERRABLE;
|
||||
|
||||
ALTER TABLE ONLY series_points
|
||||
ADD CONSTRAINT series_points_repo_name_id_fkey FOREIGN KEY (repo_name_id) REFERENCES repo_names(id) ON DELETE CASCADE DEFERRABLE;
|
||||
|
||||
ALTER TABLE ONLY series_points_snapshots
|
||||
ADD CONSTRAINT series_points_snapshots_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE;
|
||||
|
||||
ALTER TABLE ONLY series_points
|
||||
ADD CONSTRAINT series_points_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE;
|
||||
ADD CONSTRAINT series_points_repo_name_id_fkey FOREIGN KEY (repo_name_id) REFERENCES repo_names(id) ON DELETE CASCADE DEFERRABLE;
|
||||
@ -1,22 +0,0 @@
|
||||
-- Temporary function to deduplicate the logic required for each table:
|
||||
CREATE OR REPLACE FUNCTION migrate_table(table_name text)
|
||||
RETURNS void AS $$
|
||||
BEGIN
|
||||
EXECUTE format('ALTER TABLE %I DROP COLUMN IF EXISTS tenant_id;', table_name);
|
||||
END;
|
||||
$$ LANGUAGE plpgsql;
|
||||
|
||||
SELECT migrate_table('codeintel_last_reconcile');
|
||||
SELECT migrate_table('codeintel_scip_document_lookup');
|
||||
SELECT migrate_table('codeintel_scip_document_lookup_schema_versions');
|
||||
SELECT migrate_table('codeintel_scip_documents');
|
||||
SELECT migrate_table('codeintel_scip_documents_dereference_logs');
|
||||
SELECT migrate_table('codeintel_scip_metadata');
|
||||
SELECT migrate_table('codeintel_scip_symbol_names');
|
||||
SELECT migrate_table('codeintel_scip_symbols');
|
||||
SELECT migrate_table('codeintel_scip_symbols_schema_versions');
|
||||
SELECT migrate_table('rockskip_ancestry');
|
||||
SELECT migrate_table('rockskip_repos');
|
||||
SELECT migrate_table('rockskip_symbols');
|
||||
|
||||
DROP FUNCTION migrate_table(text);
|
||||
@ -1,2 +0,0 @@
|
||||
name: add tenant id to most tables
|
||||
parents: [1686315964]
|
||||
@ -1,29 +0,0 @@
|
||||
-- This migration adds the tenant_id column in a way which doesn't require
|
||||
-- updating every row. The value is null and an out of band migration will set
|
||||
-- it to the default. A later migration will enforce tenant_id to be set.
|
||||
|
||||
-- Temporary function to deduplicate the logic required for each table:
|
||||
CREATE OR REPLACE FUNCTION migrate_table(table_name text)
|
||||
RETURNS void AS $$
|
||||
BEGIN
|
||||
EXECUTE format('ALTER TABLE %I ADD COLUMN IF NOT EXISTS tenant_id integer REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE;', table_name);
|
||||
END;
|
||||
$$ LANGUAGE plpgsql;
|
||||
|
||||
SELECT migrate_table('codeintel_last_reconcile');
|
||||
SELECT migrate_table('codeintel_scip_document_lookup');
|
||||
SELECT migrate_table('codeintel_scip_document_lookup_schema_versions');
|
||||
SELECT migrate_table('codeintel_scip_documents');
|
||||
SELECT migrate_table('codeintel_scip_documents_dereference_logs');
|
||||
SELECT migrate_table('codeintel_scip_metadata');
|
||||
SELECT migrate_table('codeintel_scip_symbol_names');
|
||||
SELECT migrate_table('codeintel_scip_symbols');
|
||||
SELECT migrate_table('codeintel_scip_symbols_schema_versions');
|
||||
SELECT migrate_table('rockskip_ancestry');
|
||||
SELECT migrate_table('rockskip_repos');
|
||||
SELECT migrate_table('rockskip_symbols');
|
||||
|
||||
-- Explicitly excluded tables
|
||||
-- migration_logs :: about DB
|
||||
|
||||
DROP FUNCTION migrate_table(text);
|
||||
@ -84,8 +84,7 @@ END $$;
|
||||
|
||||
CREATE TABLE codeintel_last_reconcile (
|
||||
dump_id integer NOT NULL,
|
||||
last_reconcile_at timestamp with time zone NOT NULL,
|
||||
tenant_id integer
|
||||
last_reconcile_at timestamp with time zone NOT NULL
|
||||
);
|
||||
|
||||
COMMENT ON TABLE codeintel_last_reconcile IS 'Stores the last time processed LSIF data was reconciled with the other database.';
|
||||
@ -94,8 +93,7 @@ CREATE TABLE codeintel_scip_document_lookup (
|
||||
id bigint NOT NULL,
|
||||
upload_id integer NOT NULL,
|
||||
document_path text NOT NULL,
|
||||
document_id bigint NOT NULL,
|
||||
tenant_id integer
|
||||
document_id bigint NOT NULL
|
||||
);
|
||||
|
||||
COMMENT ON TABLE codeintel_scip_document_lookup IS 'A mapping from file paths to document references within a particular SCIP index.';
|
||||
@ -120,8 +118,7 @@ ALTER SEQUENCE codeintel_scip_document_lookup_id_seq OWNED BY codeintel_scip_doc
|
||||
CREATE TABLE codeintel_scip_document_lookup_schema_versions (
|
||||
upload_id integer NOT NULL,
|
||||
min_schema_version integer,
|
||||
max_schema_version integer,
|
||||
tenant_id integer
|
||||
max_schema_version integer
|
||||
);
|
||||
|
||||
COMMENT ON TABLE codeintel_scip_document_lookup_schema_versions IS 'Tracks the range of `schema_versions` values associated with each SCIP index in the [`codeintel_scip_document_lookup`](#table-publiccodeintel_scip_document_lookup) table.';
|
||||
@ -136,8 +133,7 @@ CREATE TABLE codeintel_scip_documents (
|
||||
id bigint NOT NULL,
|
||||
payload_hash bytea NOT NULL,
|
||||
schema_version integer NOT NULL,
|
||||
raw_scip_payload bytea NOT NULL,
|
||||
tenant_id integer
|
||||
raw_scip_payload bytea NOT NULL
|
||||
);
|
||||
|
||||
COMMENT ON TABLE codeintel_scip_documents IS 'A lookup of SCIP [Document](https://sourcegraph.com/search?q=context:%40sourcegraph/all+repo:%5Egithub%5C.com/sourcegraph/scip%24+file:%5Escip%5C.proto+message+Document&patternType=standard) payloads by their hash.';
|
||||
@ -153,8 +149,7 @@ COMMENT ON COLUMN codeintel_scip_documents.raw_scip_payload IS 'The raw, canonic
|
||||
CREATE TABLE codeintel_scip_documents_dereference_logs (
|
||||
id bigint NOT NULL,
|
||||
document_id bigint NOT NULL,
|
||||
last_removal_time timestamp with time zone DEFAULT now() NOT NULL,
|
||||
tenant_id integer
|
||||
last_removal_time timestamp with time zone DEFAULT now() NOT NULL
|
||||
);
|
||||
|
||||
COMMENT ON TABLE codeintel_scip_documents_dereference_logs IS 'A list of document rows that were recently dereferenced by the deletion of an index.';
|
||||
@ -188,8 +183,7 @@ CREATE TABLE codeintel_scip_metadata (
|
||||
tool_version text NOT NULL,
|
||||
tool_arguments text[] NOT NULL,
|
||||
text_document_encoding text NOT NULL,
|
||||
protocol_version integer NOT NULL,
|
||||
tenant_id integer
|
||||
protocol_version integer NOT NULL
|
||||
);
|
||||
|
||||
COMMENT ON TABLE codeintel_scip_metadata IS 'Global metadatadata about a single processed upload.';
|
||||
@ -221,8 +215,7 @@ CREATE TABLE codeintel_scip_symbol_names (
|
||||
id integer NOT NULL,
|
||||
upload_id integer NOT NULL,
|
||||
name_segment text NOT NULL,
|
||||
prefix_id integer,
|
||||
tenant_id integer
|
||||
prefix_id integer
|
||||
);
|
||||
|
||||
COMMENT ON TABLE codeintel_scip_symbol_names IS 'Stores a prefix tree of symbol names within a particular upload.';
|
||||
@ -243,8 +236,7 @@ CREATE TABLE codeintel_scip_symbols (
|
||||
reference_ranges bytea,
|
||||
implementation_ranges bytea,
|
||||
type_definition_ranges bytea,
|
||||
symbol_id integer NOT NULL,
|
||||
tenant_id integer
|
||||
symbol_id integer NOT NULL
|
||||
);
|
||||
|
||||
COMMENT ON TABLE codeintel_scip_symbols IS 'A mapping from SCIP [Symbol names](https://sourcegraph.com/search?q=context:%40sourcegraph/all+repo:%5Egithub%5C.com/sourcegraph/scip%24+file:%5Escip%5C.proto+message+Symbol&patternType=standard) to path and ranges where that symbol occurs within a particular SCIP index.';
|
||||
@ -268,8 +260,7 @@ COMMENT ON COLUMN codeintel_scip_symbols.symbol_id IS 'The identifier of the seg
|
||||
CREATE TABLE codeintel_scip_symbols_schema_versions (
|
||||
upload_id integer NOT NULL,
|
||||
min_schema_version integer,
|
||||
max_schema_version integer,
|
||||
tenant_id integer
|
||||
max_schema_version integer
|
||||
);
|
||||
|
||||
COMMENT ON TABLE codeintel_scip_symbols_schema_versions IS 'Tracks the range of `schema_versions` for each index in the [`codeintel_scip_symbols`](#table-publiccodeintel_scip_symbols) table.';
|
||||
@ -285,8 +276,7 @@ CREATE TABLE rockskip_ancestry (
|
||||
repo_id integer NOT NULL,
|
||||
commit_id character varying(40) NOT NULL,
|
||||
height integer NOT NULL,
|
||||
ancestor integer NOT NULL,
|
||||
tenant_id integer
|
||||
ancestor integer NOT NULL
|
||||
);
|
||||
|
||||
CREATE SEQUENCE rockskip_ancestry_id_seq
|
||||
@ -302,8 +292,7 @@ ALTER SEQUENCE rockskip_ancestry_id_seq OWNED BY rockskip_ancestry.id;
|
||||
CREATE TABLE rockskip_repos (
|
||||
id integer NOT NULL,
|
||||
repo text NOT NULL,
|
||||
last_accessed_at timestamp with time zone NOT NULL,
|
||||
tenant_id integer
|
||||
last_accessed_at timestamp with time zone NOT NULL
|
||||
);
|
||||
|
||||
CREATE SEQUENCE rockskip_repos_id_seq
|
||||
@ -322,8 +311,7 @@ CREATE TABLE rockskip_symbols (
|
||||
deleted integer[] NOT NULL,
|
||||
repo_id integer NOT NULL,
|
||||
path text NOT NULL,
|
||||
name text NOT NULL,
|
||||
tenant_id integer
|
||||
name text NOT NULL
|
||||
);
|
||||
|
||||
CREATE SEQUENCE rockskip_symbols_id_seq
|
||||
@ -449,44 +437,8 @@ CREATE TRIGGER codeintel_scip_documents_dereference_logs_insert AFTER DELETE ON
|
||||
|
||||
CREATE TRIGGER codeintel_scip_symbols_schema_versions_insert AFTER INSERT ON codeintel_scip_symbols REFERENCING NEW TABLE AS newtab FOR EACH STATEMENT EXECUTE FUNCTION update_codeintel_scip_symbols_schema_versions_insert();
|
||||
|
||||
ALTER TABLE ONLY codeintel_last_reconcile
|
||||
ADD CONSTRAINT codeintel_last_reconcile_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE;
|
||||
|
||||
ALTER TABLE ONLY codeintel_scip_document_lookup
|
||||
ADD CONSTRAINT codeintel_scip_document_lookup_document_id_fk FOREIGN KEY (document_id) REFERENCES codeintel_scip_documents(id);
|
||||
|
||||
ALTER TABLE ONLY codeintel_scip_document_lookup_schema_versions
|
||||
ADD CONSTRAINT codeintel_scip_document_lookup_schema_versions_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE;
|
||||
|
||||
ALTER TABLE ONLY codeintel_scip_document_lookup
|
||||
ADD CONSTRAINT codeintel_scip_document_lookup_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE;
|
||||
|
||||
ALTER TABLE ONLY codeintel_scip_documents_dereference_logs
|
||||
ADD CONSTRAINT codeintel_scip_documents_dereference_logs_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE;
|
||||
|
||||
ALTER TABLE ONLY codeintel_scip_documents
|
||||
ADD CONSTRAINT codeintel_scip_documents_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE;
|
||||
|
||||
ALTER TABLE ONLY codeintel_scip_metadata
|
||||
ADD CONSTRAINT codeintel_scip_metadata_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE;
|
||||
|
||||
ALTER TABLE ONLY codeintel_scip_symbol_names
|
||||
ADD CONSTRAINT codeintel_scip_symbol_names_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE;
|
||||
|
||||
ALTER TABLE ONLY codeintel_scip_symbols
|
||||
ADD CONSTRAINT codeintel_scip_symbols_document_lookup_id_fk FOREIGN KEY (document_lookup_id) REFERENCES codeintel_scip_document_lookup(id) ON DELETE CASCADE;
|
||||
|
||||
ALTER TABLE ONLY codeintel_scip_symbols_schema_versions
|
||||
ADD CONSTRAINT codeintel_scip_symbols_schema_versions_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE;
|
||||
|
||||
ALTER TABLE ONLY codeintel_scip_symbols
|
||||
ADD CONSTRAINT codeintel_scip_symbols_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE;
|
||||
|
||||
ALTER TABLE ONLY rockskip_ancestry
|
||||
ADD CONSTRAINT rockskip_ancestry_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE;
|
||||
|
||||
ALTER TABLE ONLY rockskip_repos
|
||||
ADD CONSTRAINT rockskip_repos_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE;
|
||||
|
||||
ALTER TABLE ONLY rockskip_symbols
|
||||
ADD CONSTRAINT rockskip_symbols_tenant_id_fkey FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE;
|
||||
ADD CONSTRAINT codeintel_scip_symbols_document_lookup_id_fk FOREIGN KEY (document_lookup_id) REFERENCES codeintel_scip_document_lookup(id) ON DELETE CASCADE;
|
||||
@ -1,187 +0,0 @@
|
||||
-- Temporary function to deduplicate the logic required for each table:
|
||||
CREATE OR REPLACE FUNCTION migrate_table(table_name text)
|
||||
RETURNS void AS $$
|
||||
BEGIN
|
||||
EXECUTE format('ALTER TABLE %I DROP COLUMN IF EXISTS tenant_id;', table_name);
|
||||
END;
|
||||
$$ LANGUAGE plpgsql;
|
||||
|
||||
SELECT migrate_table('access_requests');
|
||||
SELECT migrate_table('access_tokens');
|
||||
SELECT migrate_table('aggregated_user_statistics');
|
||||
SELECT migrate_table('assigned_owners');
|
||||
SELECT migrate_table('assigned_teams');
|
||||
SELECT migrate_table('batch_changes');
|
||||
SELECT migrate_table('batch_changes_site_credentials');
|
||||
SELECT migrate_table('batch_spec_execution_cache_entries');
|
||||
SELECT migrate_table('batch_spec_resolution_jobs');
|
||||
SELECT migrate_table('batch_spec_workspace_execution_jobs');
|
||||
SELECT migrate_table('batch_spec_workspace_execution_last_dequeues');
|
||||
SELECT migrate_table('batch_spec_workspace_files');
|
||||
SELECT migrate_table('batch_spec_workspaces');
|
||||
SELECT migrate_table('batch_specs');
|
||||
SELECT migrate_table('cached_available_indexers');
|
||||
SELECT migrate_table('changeset_events');
|
||||
SELECT migrate_table('changeset_jobs');
|
||||
SELECT migrate_table('changeset_specs');
|
||||
SELECT migrate_table('changesets');
|
||||
SELECT migrate_table('cm_action_jobs');
|
||||
SELECT migrate_table('cm_emails');
|
||||
SELECT migrate_table('cm_last_searched');
|
||||
SELECT migrate_table('cm_monitors');
|
||||
SELECT migrate_table('cm_queries');
|
||||
SELECT migrate_table('cm_recipients');
|
||||
SELECT migrate_table('cm_slack_webhooks');
|
||||
SELECT migrate_table('cm_trigger_jobs');
|
||||
SELECT migrate_table('cm_webhooks');
|
||||
SELECT migrate_table('code_hosts');
|
||||
SELECT migrate_table('codeintel_autoindex_queue');
|
||||
SELECT migrate_table('codeintel_autoindexing_exceptions');
|
||||
SELECT migrate_table('codeintel_commit_dates');
|
||||
SELECT migrate_table('codeintel_inference_scripts');
|
||||
SELECT migrate_table('codeintel_initial_path_ranks');
|
||||
SELECT migrate_table('codeintel_initial_path_ranks_processed');
|
||||
SELECT migrate_table('codeintel_langugage_support_requests');
|
||||
SELECT migrate_table('codeintel_path_ranks');
|
||||
SELECT migrate_table('codeintel_ranking_definitions');
|
||||
SELECT migrate_table('codeintel_ranking_exports');
|
||||
SELECT migrate_table('codeintel_ranking_graph_keys');
|
||||
SELECT migrate_table('codeintel_ranking_path_counts_inputs');
|
||||
SELECT migrate_table('codeintel_ranking_progress');
|
||||
SELECT migrate_table('codeintel_ranking_references');
|
||||
SELECT migrate_table('codeintel_ranking_references_processed');
|
||||
SELECT migrate_table('codeowners');
|
||||
SELECT migrate_table('codeowners_individual_stats');
|
||||
SELECT migrate_table('codeowners_owners');
|
||||
SELECT migrate_table('commit_authors');
|
||||
SELECT migrate_table('configuration_policies_audit_logs');
|
||||
SELECT migrate_table('context_detection_embedding_jobs');
|
||||
SELECT migrate_table('discussion_comments');
|
||||
SELECT migrate_table('discussion_mail_reply_tokens');
|
||||
SELECT migrate_table('discussion_threads');
|
||||
SELECT migrate_table('discussion_threads_target_repo');
|
||||
SELECT migrate_table('event_logs');
|
||||
SELECT migrate_table('event_logs_export_allowlist');
|
||||
SELECT migrate_table('event_logs_scrape_state');
|
||||
SELECT migrate_table('event_logs_scrape_state_own');
|
||||
SELECT migrate_table('executor_heartbeats');
|
||||
SELECT migrate_table('executor_job_tokens');
|
||||
SELECT migrate_table('executor_secret_access_logs');
|
||||
SELECT migrate_table('executor_secrets');
|
||||
SELECT migrate_table('exhaustive_search_jobs');
|
||||
SELECT migrate_table('exhaustive_search_repo_jobs');
|
||||
SELECT migrate_table('exhaustive_search_repo_revision_jobs');
|
||||
SELECT migrate_table('explicit_permissions_bitbucket_projects_jobs');
|
||||
SELECT migrate_table('external_service_repos');
|
||||
SELECT migrate_table('external_service_sync_jobs');
|
||||
SELECT migrate_table('external_services');
|
||||
SELECT migrate_table('feature_flag_overrides');
|
||||
SELECT migrate_table('feature_flags');
|
||||
SELECT migrate_table('github_app_installs');
|
||||
SELECT migrate_table('github_apps');
|
||||
SELECT migrate_table('gitserver_relocator_jobs');
|
||||
SELECT migrate_table('gitserver_repos');
|
||||
SELECT migrate_table('gitserver_repos_statistics');
|
||||
SELECT migrate_table('gitserver_repos_sync_output');
|
||||
SELECT migrate_table('global_state');
|
||||
SELECT migrate_table('insights_query_runner_jobs');
|
||||
SELECT migrate_table('insights_query_runner_jobs_dependencies');
|
||||
SELECT migrate_table('insights_settings_migration_jobs');
|
||||
SELECT migrate_table('lsif_configuration_policies');
|
||||
SELECT migrate_table('lsif_configuration_policies_repository_pattern_lookup');
|
||||
SELECT migrate_table('lsif_dependency_indexing_jobs');
|
||||
SELECT migrate_table('lsif_dependency_repos');
|
||||
SELECT migrate_table('lsif_dependency_syncing_jobs');
|
||||
SELECT migrate_table('lsif_dirty_repositories');
|
||||
SELECT migrate_table('lsif_index_configuration');
|
||||
SELECT migrate_table('lsif_indexes');
|
||||
SELECT migrate_table('lsif_last_index_scan');
|
||||
SELECT migrate_table('lsif_last_retention_scan');
|
||||
SELECT migrate_table('lsif_nearest_uploads');
|
||||
SELECT migrate_table('lsif_nearest_uploads_links');
|
||||
SELECT migrate_table('lsif_packages');
|
||||
SELECT migrate_table('lsif_references');
|
||||
SELECT migrate_table('lsif_retention_configuration');
|
||||
SELECT migrate_table('lsif_uploads');
|
||||
SELECT migrate_table('lsif_uploads_audit_logs');
|
||||
SELECT migrate_table('lsif_uploads_reference_counts');
|
||||
SELECT migrate_table('lsif_uploads_visible_at_tip');
|
||||
SELECT migrate_table('lsif_uploads_vulnerability_scan');
|
||||
SELECT migrate_table('names');
|
||||
SELECT migrate_table('namespace_permissions');
|
||||
SELECT migrate_table('notebook_stars');
|
||||
SELECT migrate_table('notebooks');
|
||||
SELECT migrate_table('org_invitations');
|
||||
SELECT migrate_table('org_members');
|
||||
SELECT migrate_table('org_stats');
|
||||
SELECT migrate_table('orgs');
|
||||
SELECT migrate_table('orgs_open_beta_stats');
|
||||
SELECT migrate_table('out_of_band_migrations');
|
||||
SELECT migrate_table('out_of_band_migrations_errors');
|
||||
SELECT migrate_table('outbound_webhook_event_types');
|
||||
SELECT migrate_table('outbound_webhook_jobs');
|
||||
SELECT migrate_table('outbound_webhook_logs');
|
||||
SELECT migrate_table('outbound_webhooks');
|
||||
SELECT migrate_table('own_aggregate_recent_contribution');
|
||||
SELECT migrate_table('own_aggregate_recent_view');
|
||||
SELECT migrate_table('own_background_jobs');
|
||||
SELECT migrate_table('own_signal_configurations');
|
||||
SELECT migrate_table('own_signal_recent_contribution');
|
||||
SELECT migrate_table('ownership_path_stats');
|
||||
SELECT migrate_table('package_repo_filters');
|
||||
SELECT migrate_table('package_repo_versions');
|
||||
SELECT migrate_table('permission_sync_jobs');
|
||||
SELECT migrate_table('permissions');
|
||||
SELECT migrate_table('phabricator_repos');
|
||||
SELECT migrate_table('product_licenses');
|
||||
SELECT migrate_table('product_subscriptions');
|
||||
SELECT migrate_table('prompts');
|
||||
SELECT migrate_table('query_runner_state');
|
||||
SELECT migrate_table('redis_key_value');
|
||||
SELECT migrate_table('registry_extension_releases');
|
||||
SELECT migrate_table('registry_extensions');
|
||||
SELECT migrate_table('repo');
|
||||
SELECT migrate_table('repo_commits_changelists');
|
||||
SELECT migrate_table('repo_embedding_job_stats');
|
||||
SELECT migrate_table('repo_embedding_jobs');
|
||||
SELECT migrate_table('repo_kvps');
|
||||
SELECT migrate_table('repo_paths');
|
||||
SELECT migrate_table('repo_pending_permissions');
|
||||
SELECT migrate_table('repo_permissions');
|
||||
SELECT migrate_table('repo_statistics');
|
||||
SELECT migrate_table('role_permissions');
|
||||
SELECT migrate_table('roles');
|
||||
SELECT migrate_table('saved_searches');
|
||||
SELECT migrate_table('search_context_default');
|
||||
SELECT migrate_table('search_context_repos');
|
||||
SELECT migrate_table('search_context_stars');
|
||||
SELECT migrate_table('search_contexts');
|
||||
SELECT migrate_table('security_event_logs');
|
||||
SELECT migrate_table('settings');
|
||||
SELECT migrate_table('sub_repo_permissions');
|
||||
SELECT migrate_table('survey_responses');
|
||||
SELECT migrate_table('syntactic_scip_indexing_jobs');
|
||||
SELECT migrate_table('syntactic_scip_last_index_scan');
|
||||
SELECT migrate_table('team_members');
|
||||
SELECT migrate_table('teams');
|
||||
SELECT migrate_table('telemetry_events_export_queue');
|
||||
SELECT migrate_table('temporary_settings');
|
||||
SELECT migrate_table('user_credentials');
|
||||
SELECT migrate_table('user_emails');
|
||||
SELECT migrate_table('user_external_accounts');
|
||||
SELECT migrate_table('user_onboarding_tour');
|
||||
SELECT migrate_table('user_pending_permissions');
|
||||
SELECT migrate_table('user_permissions');
|
||||
SELECT migrate_table('user_public_repos');
|
||||
SELECT migrate_table('user_repo_permissions');
|
||||
SELECT migrate_table('user_roles');
|
||||
SELECT migrate_table('users');
|
||||
SELECT migrate_table('vulnerabilities');
|
||||
SELECT migrate_table('vulnerability_affected_packages');
|
||||
SELECT migrate_table('vulnerability_affected_symbols');
|
||||
SELECT migrate_table('vulnerability_matches');
|
||||
SELECT migrate_table('webhook_logs');
|
||||
SELECT migrate_table('webhooks');
|
||||
SELECT migrate_table('zoekt_repos');
|
||||
|
||||
DROP FUNCTION migrate_table(text);
|
||||
@ -1,2 +0,0 @@
|
||||
name: Add tenant ID to most tables
|
||||
parents: [1722961262]
|
||||
@ -1,197 +0,0 @@
|
||||
-- This migration adds the tenant_id column in a way which doesn't require
|
||||
-- updating every row. The value is null and an out of band migration will set
|
||||
-- it to the default. A later migration will enforce tenant_id to be set.
|
||||
|
||||
-- Temporary function to deduplicate the logic required for each table:
|
||||
CREATE OR REPLACE FUNCTION migrate_table(table_name text)
|
||||
RETURNS void AS $$
|
||||
BEGIN
|
||||
EXECUTE format('ALTER TABLE %I ADD COLUMN IF NOT EXISTS tenant_id integer REFERENCES tenants(id) ON UPDATE CASCADE ON DELETE CASCADE;', table_name);
|
||||
END;
|
||||
$$ LANGUAGE plpgsql;
|
||||
|
||||
SELECT migrate_table('access_requests');
|
||||
SELECT migrate_table('access_tokens');
|
||||
SELECT migrate_table('aggregated_user_statistics');
|
||||
SELECT migrate_table('assigned_owners');
|
||||
SELECT migrate_table('assigned_teams');
|
||||
SELECT migrate_table('batch_changes');
|
||||
SELECT migrate_table('batch_changes_site_credentials');
|
||||
SELECT migrate_table('batch_spec_execution_cache_entries');
|
||||
SELECT migrate_table('batch_spec_resolution_jobs');
|
||||
SELECT migrate_table('batch_spec_workspace_execution_jobs');
|
||||
SELECT migrate_table('batch_spec_workspace_execution_last_dequeues');
|
||||
SELECT migrate_table('batch_spec_workspace_files');
|
||||
SELECT migrate_table('batch_spec_workspaces');
|
||||
SELECT migrate_table('batch_specs');
|
||||
SELECT migrate_table('cached_available_indexers');
|
||||
SELECT migrate_table('changeset_events');
|
||||
SELECT migrate_table('changeset_jobs');
|
||||
SELECT migrate_table('changeset_specs');
|
||||
SELECT migrate_table('changesets');
|
||||
SELECT migrate_table('cm_action_jobs');
|
||||
SELECT migrate_table('cm_emails');
|
||||
SELECT migrate_table('cm_last_searched');
|
||||
SELECT migrate_table('cm_monitors');
|
||||
SELECT migrate_table('cm_queries');
|
||||
SELECT migrate_table('cm_recipients');
|
||||
SELECT migrate_table('cm_slack_webhooks');
|
||||
SELECT migrate_table('cm_trigger_jobs');
|
||||
SELECT migrate_table('cm_webhooks');
|
||||
SELECT migrate_table('code_hosts');
|
||||
SELECT migrate_table('codeintel_autoindex_queue');
|
||||
SELECT migrate_table('codeintel_autoindexing_exceptions');
|
||||
SELECT migrate_table('codeintel_commit_dates');
|
||||
SELECT migrate_table('codeintel_inference_scripts');
|
||||
SELECT migrate_table('codeintel_initial_path_ranks');
|
||||
SELECT migrate_table('codeintel_initial_path_ranks_processed');
|
||||
SELECT migrate_table('codeintel_langugage_support_requests');
|
||||
SELECT migrate_table('codeintel_path_ranks');
|
||||
SELECT migrate_table('codeintel_ranking_definitions');
|
||||
SELECT migrate_table('codeintel_ranking_exports');
|
||||
SELECT migrate_table('codeintel_ranking_graph_keys');
|
||||
SELECT migrate_table('codeintel_ranking_path_counts_inputs');
|
||||
SELECT migrate_table('codeintel_ranking_progress');
|
||||
SELECT migrate_table('codeintel_ranking_references');
|
||||
SELECT migrate_table('codeintel_ranking_references_processed');
|
||||
SELECT migrate_table('codeowners');
|
||||
SELECT migrate_table('codeowners_individual_stats');
|
||||
SELECT migrate_table('codeowners_owners');
|
||||
SELECT migrate_table('commit_authors');
|
||||
SELECT migrate_table('configuration_policies_audit_logs');
|
||||
SELECT migrate_table('context_detection_embedding_jobs');
|
||||
SELECT migrate_table('discussion_comments');
|
||||
SELECT migrate_table('discussion_mail_reply_tokens');
|
||||
SELECT migrate_table('discussion_threads');
|
||||
SELECT migrate_table('discussion_threads_target_repo');
|
||||
SELECT migrate_table('event_logs');
|
||||
SELECT migrate_table('event_logs_export_allowlist');
|
||||
SELECT migrate_table('event_logs_scrape_state');
|
||||
SELECT migrate_table('event_logs_scrape_state_own');
|
||||
SELECT migrate_table('executor_heartbeats');
|
||||
SELECT migrate_table('executor_job_tokens');
|
||||
SELECT migrate_table('executor_secret_access_logs');
|
||||
SELECT migrate_table('executor_secrets');
|
||||
SELECT migrate_table('exhaustive_search_jobs');
|
||||
SELECT migrate_table('exhaustive_search_repo_jobs');
|
||||
SELECT migrate_table('exhaustive_search_repo_revision_jobs');
|
||||
SELECT migrate_table('explicit_permissions_bitbucket_projects_jobs');
|
||||
SELECT migrate_table('external_service_repos');
|
||||
SELECT migrate_table('external_service_sync_jobs');
|
||||
SELECT migrate_table('external_services');
|
||||
SELECT migrate_table('feature_flag_overrides');
|
||||
SELECT migrate_table('feature_flags');
|
||||
SELECT migrate_table('github_app_installs');
|
||||
SELECT migrate_table('github_apps');
|
||||
SELECT migrate_table('gitserver_relocator_jobs');
|
||||
SELECT migrate_table('gitserver_repos');
|
||||
SELECT migrate_table('gitserver_repos_statistics');
|
||||
SELECT migrate_table('gitserver_repos_sync_output');
|
||||
SELECT migrate_table('global_state');
|
||||
SELECT migrate_table('insights_query_runner_jobs');
|
||||
SELECT migrate_table('insights_query_runner_jobs_dependencies');
|
||||
SELECT migrate_table('insights_settings_migration_jobs');
|
||||
SELECT migrate_table('lsif_configuration_policies');
|
||||
SELECT migrate_table('lsif_configuration_policies_repository_pattern_lookup');
|
||||
SELECT migrate_table('lsif_dependency_indexing_jobs');
|
||||
SELECT migrate_table('lsif_dependency_repos');
|
||||
SELECT migrate_table('lsif_dependency_syncing_jobs');
|
||||
SELECT migrate_table('lsif_dirty_repositories');
|
||||
SELECT migrate_table('lsif_index_configuration');
|
||||
SELECT migrate_table('lsif_indexes');
|
||||
SELECT migrate_table('lsif_last_index_scan');
|
||||
SELECT migrate_table('lsif_last_retention_scan');
|
||||
SELECT migrate_table('lsif_nearest_uploads');
|
||||
SELECT migrate_table('lsif_nearest_uploads_links');
|
||||
SELECT migrate_table('lsif_packages');
|
||||
SELECT migrate_table('lsif_references');
|
||||
SELECT migrate_table('lsif_retention_configuration');
|
||||
SELECT migrate_table('lsif_uploads');
|
||||
SELECT migrate_table('lsif_uploads_audit_logs');
|
||||
SELECT migrate_table('lsif_uploads_reference_counts');
|
||||
SELECT migrate_table('lsif_uploads_visible_at_tip');
|
||||
SELECT migrate_table('lsif_uploads_vulnerability_scan');
|
||||
SELECT migrate_table('names');
|
||||
SELECT migrate_table('namespace_permissions');
|
||||
SELECT migrate_table('notebook_stars');
|
||||
SELECT migrate_table('notebooks');
|
||||
SELECT migrate_table('org_invitations');
|
||||
SELECT migrate_table('org_members');
|
||||
SELECT migrate_table('org_stats');
|
||||
SELECT migrate_table('orgs');
|
||||
SELECT migrate_table('orgs_open_beta_stats');
|
||||
SELECT migrate_table('out_of_band_migrations');
|
||||
SELECT migrate_table('out_of_band_migrations_errors');
|
||||
SELECT migrate_table('outbound_webhook_event_types');
|
||||
SELECT migrate_table('outbound_webhook_jobs');
|
||||
SELECT migrate_table('outbound_webhook_logs');
|
||||
SELECT migrate_table('outbound_webhooks');
|
||||
SELECT migrate_table('own_aggregate_recent_contribution');
|
||||
SELECT migrate_table('own_aggregate_recent_view');
|
||||
SELECT migrate_table('own_background_jobs');
|
||||
SELECT migrate_table('own_signal_configurations');
|
||||
SELECT migrate_table('own_signal_recent_contribution');
|
||||
SELECT migrate_table('ownership_path_stats');
|
||||
SELECT migrate_table('package_repo_filters');
|
||||
SELECT migrate_table('package_repo_versions');
|
||||
SELECT migrate_table('permission_sync_jobs');
|
||||
SELECT migrate_table('permissions');
|
||||
SELECT migrate_table('phabricator_repos');
|
||||
SELECT migrate_table('product_licenses');
|
||||
SELECT migrate_table('product_subscriptions');
|
||||
SELECT migrate_table('prompts');
|
||||
SELECT migrate_table('query_runner_state');
|
||||
SELECT migrate_table('redis_key_value');
|
||||
SELECT migrate_table('registry_extension_releases');
|
||||
SELECT migrate_table('registry_extensions');
|
||||
SELECT migrate_table('repo');
|
||||
SELECT migrate_table('repo_commits_changelists');
|
||||
SELECT migrate_table('repo_embedding_job_stats');
|
||||
SELECT migrate_table('repo_embedding_jobs');
|
||||
SELECT migrate_table('repo_kvps');
|
||||
SELECT migrate_table('repo_paths');
|
||||
SELECT migrate_table('repo_pending_permissions');
|
||||
SELECT migrate_table('repo_permissions');
|
||||
SELECT migrate_table('repo_statistics');
|
||||
SELECT migrate_table('role_permissions');
|
||||
SELECT migrate_table('roles');
|
||||
SELECT migrate_table('saved_searches');
|
||||
SELECT migrate_table('search_context_default');
|
||||
SELECT migrate_table('search_context_repos');
|
||||
SELECT migrate_table('search_context_stars');
|
||||
SELECT migrate_table('search_contexts');
|
||||
SELECT migrate_table('security_event_logs');
|
||||
SELECT migrate_table('settings');
|
||||
SELECT migrate_table('sub_repo_permissions');
|
||||
SELECT migrate_table('survey_responses');
|
||||
SELECT migrate_table('syntactic_scip_indexing_jobs');
|
||||
SELECT migrate_table('syntactic_scip_last_index_scan');
|
||||
SELECT migrate_table('team_members');
|
||||
SELECT migrate_table('teams');
|
||||
SELECT migrate_table('telemetry_events_export_queue');
|
||||
SELECT migrate_table('temporary_settings');
|
||||
SELECT migrate_table('user_credentials');
|
||||
SELECT migrate_table('user_emails');
|
||||
SELECT migrate_table('user_external_accounts');
|
||||
SELECT migrate_table('user_onboarding_tour');
|
||||
SELECT migrate_table('user_pending_permissions');
|
||||
SELECT migrate_table('user_permissions');
|
||||
SELECT migrate_table('user_public_repos');
|
||||
SELECT migrate_table('user_repo_permissions');
|
||||
SELECT migrate_table('user_roles');
|
||||
SELECT migrate_table('users');
|
||||
SELECT migrate_table('vulnerabilities');
|
||||
SELECT migrate_table('vulnerability_affected_packages');
|
||||
SELECT migrate_table('vulnerability_affected_symbols');
|
||||
SELECT migrate_table('vulnerability_matches');
|
||||
SELECT migrate_table('webhook_logs');
|
||||
SELECT migrate_table('webhooks');
|
||||
SELECT migrate_table('zoekt_repos');
|
||||
|
||||
-- Explicitly excluded tables
|
||||
-- critical_and_site_config :: for instance not tenant
|
||||
-- migration_logs :: about DB
|
||||
-- tenants :: it is the foreign table
|
||||
-- versions :: about the instance not the tenant
|
||||
|
||||
DROP FUNCTION migrate_table(text);
|
||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user