go.chromium.org/luci@v0.0.0-20240309015107-7cdc2e660f33/luci_notify/internal/span/init_db.sql (about) 1 -- Copyright 2024 The LUCI Authors. 2 -- 3 -- Licensed under the Apache License, Version 2.0 (the "License"); 4 -- you may not use this file except in compliance with the License. 5 -- You may obtain a copy of the License at 6 -- 7 -- http://www.apache.org/licenses/LICENSE-2.0 8 -- 9 -- Unless required by applicable law or agreed to in writing, software 10 -- distributed under the License is distributed on an "AS IS" BASIS, 11 -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 -- See the License for the specific language governing permissions and 13 -- limitations under the License. 14 15 -------------------------------------------------------------------------------- 16 -- This script initializes a LUCI Notify Spanner database. 17 18 -- Alerts are individual alert items about the state of the builders. 19 -- Currently these are mapped 1:1 to Sheriff-o-Matic alerts, but will 20 -- change in the future if we move away from Sheriff-o-Matic. 21 -- TTL is set at 30 days to keep the table size reasonably small for fast queries. 22 CREATE TABLE Alerts ( 23 -- The key of the alert. 24 -- For now, this matches the key of the alert in Sheriff-o-Matic. 25 -- This may be revised in the future. 26 AlertKey STRING(256) NOT NULL, 27 -- The bug number in Buganizer/IssueTracker. 28 -- NULL if the alert is not linked to a bug. 29 Bug INT64, 30 -- The build number to consider this alert silenced until. 31 -- NULL if the alert is not silenced. 32 SilenceUntil INT64, 33 -- The time the alert was last modified. 34 -- Used to control TTL of alert values. 35 ModifyTime TIMESTAMP NOT NULL OPTIONS (allow_commit_timestamp=true), 36 ) PRIMARY KEY (AlertKey), 37 ROW DELETION POLICY (OLDER_THAN(ModifyTime, INTERVAL 30 DAY));