Skip to content

Commit

Permalink
Update eclipse data model with advanced weather time. Add SQL definit…
Browse files Browse the repository at this point in the history
…ion.
  • Loading branch information
Carifio24 committed Mar 14, 2024
1 parent eb15117 commit 96ea457
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/stories/solar-eclipse-2024/models/eclipse_data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export class SolarEclipse2024Data extends Model<InferAttributes<SolarEclipse2024
declare cloud_cover_selected_locations_count: number;
declare info_time_ms: CreationOptional<number>;
declare app_time_ms: CreationOptional<number>;
declare advanced_weather_time_ms: CreationOptional<number>;
declare timestamp: CreationOptional<Date>;
}

Expand Down Expand Up @@ -51,6 +52,11 @@ export function initializeSolarEclipse2024DataModel(sequelize: Sequelize) {
allowNull: false,
defaultValue: 0
},
advanced_weather_time_ms: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: 0
},
timestamp: {
type: DataTypes.DATE,
allowNull: false,
Expand Down
15 changes: 15 additions & 0 deletions src/stories/solar-eclipse-2024/sql/create_eclipse_data_table.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
CREATE TABLE SolarEclipse2024Data (
id int(11) UNSIGNED NOT NULL UNIQUE AUTO_INCREMENT,
user_uuid varchar(36) NOT NULL UNIQUE,
user_selected_locations JSON NOT NULL,
user_selected_locations_count INT NOT NULL,
cloud_cover_selected_locations JSON NOT NULL,
cloud_cover_selected_locations_count INT NOT NULL,
app_time_ms INT NOT NULL DEFAULT 0,
info_time_ms INT NOT NULL DEFAULT 0,
advanced_weather_time_ms INT NOT NULL DEFAULT 0,
timestamp TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,

PRIMARY KEY(id),
INDEX(user_uuid)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci PACK_KEYS=0;

0 comments on commit 96ea457

Please sign in to comment.