From a7b04fc79b31ac51c84e5818e8366a98f6e8a224 Mon Sep 17 00:00:00 2001 From: jona159 Date: Wed, 22 Jul 2026 08:22:05 +0200 Subject: [PATCH 1/6] feat: migrate to RQv2 --- app/db.server.ts | 11 ++-- app/db/relations.ts | 103 ++++++++++++++++++++++++++++++++++ app/db/schema/action-token.ts | 8 --- app/db/schema/device.ts | 37 +----------- app/db/schema/location.ts | 11 +--- app/db/schema/log-entry.ts | 15 +---- app/db/schema/measurement.ts | 13 +---- app/db/schema/profile.ts | 21 +------ app/db/schema/refreshToken.ts | 9 +-- app/db/schema/sensor.ts | 18 +----- app/db/schema/user.ts | 28 +-------- 11 files changed, 119 insertions(+), 155 deletions(-) create mode 100644 app/db/relations.ts diff --git a/app/db.server.ts b/app/db.server.ts index cd399be00..d4be0f66f 100644 --- a/app/db.server.ts +++ b/app/db.server.ts @@ -1,14 +1,14 @@ import { drizzle, type PostgresJsDatabase } from 'drizzle-orm/postgres-js' import postgres, { type Sql } from 'postgres' import invariant from 'tiny-invariant' -import * as schema from './db/schema' +import { relations } from './db/relations' -let drizzleClient: PostgresJsDatabase +let drizzleClient: PostgresJsDatabase let pg: Sql declare global { var __db__: | { - drizzle: PostgresJsDatabase + drizzle: PostgresJsDatabase pg: Sql } | undefined @@ -39,7 +39,7 @@ function initClient() { max: maxConnections, }) - const drizzleDb = drizzle(rawPg, { schema }) + const drizzleDb = drizzle({ client: rawPg, relations }) return { drizzle: drizzleDb, pg: rawPg } } @@ -57,3 +57,6 @@ function parsePoolSize(value: string | undefined): number { } export { drizzleClient, pg } +export type DrizzleTransaction = Parameters< + Parameters[0] +>[0] diff --git a/app/db/relations.ts b/app/db/relations.ts new file mode 100644 index 000000000..2d210d8cb --- /dev/null +++ b/app/db/relations.ts @@ -0,0 +1,103 @@ +import { defineRelations } from 'drizzle-orm' +import * as schema from './schema' + +export const relations = defineRelations(schema, (r) => ({ + user: { + password: r.one.password({ + from: r.user.id, + to: r.password.userId, + optional: false, + }), + profile: r.one.profile({ + from: r.user.id, + to: r.profile.userId, + }), + devices: r.many.device(), + refreshToken: r.many.refreshToken(), + actionTokens: r.many.actionToken(), + }, + device: { + user: r.one.user({ + from: r.device.userId, + to: r.user.id, + optional: false, + }), + sensors: r.many.sensor(), + locations: r.many.deviceToLocation(), + geometries: r.many.location({ + from: r.device.id.through(r.deviceToLocation.deviceId), + to: r.location.id.through(r.deviceToLocation.locationId), + }), + logEntries: r.many.logEntry(), + }, + deviceToLocation: { + device: r.one.device({ + from: r.deviceToLocation.deviceId, + to: r.device.id, + optional: false, + }), + geometry: r.one.location({ + from: r.deviceToLocation.locationId, + to: r.location.id, + optional: false, + }), + }, + sensor: { + device: r.one.device({ + from: r.sensor.deviceId, + to: r.device.id, + optional: false, + }), + measurements: r.many.measurement({ + from: r.sensor.id, + to: r.measurement.sensorId, + }), + }, + measurement: { + sensor: r.one.sensor({ + from: r.measurement.sensorId, + to: r.sensor.id, + optional: false, + }), + location: r.one.location({ + from: r.measurement.locationId, + to: r.location.id, + }), + }, + location: { + measurements: r.many.measurement(), + devices: r.many.device(), + }, + profile: { + user: r.one.user({ + from: r.profile.userId, + to: r.user.id, + optional: false, + }), + profileImage: r.one.profileImage({ + from: r.profile.id, + to: r.profileImage.profileId, + }), + }, + actionToken: { + user: r.one.user({ + from: r.actionToken.userId, + to: r.user.id, + optional: false, + }), + }, + refreshToken: { + user: r.one.user({ + from: r.refreshToken.userId, + to: r.user.id, + optional: false, + }), + }, + logEntry: { + device: r.one.device({ + from: r.logEntry.deviceId, + to: r.device.id, + optional: false, + }), + }, +})) diff --git a/app/db/schema/action-token.ts b/app/db/schema/action-token.ts index 7441dbb97..002275f84 100644 --- a/app/db/schema/action-token.ts +++ b/app/db/schema/action-token.ts @@ -1,5 +1,4 @@ import { createId } from '@paralleldrive/cuid2' -import { relations } from 'drizzle-orm' import { pgTable, text, @@ -42,10 +41,3 @@ export const actionToken = pgTable( expiresAtIdx: index('action_token_expires_at_idx').on(t.expiresAt), }), ) - -export const actionTokenRelations = relations(actionToken, ({ one }) => ({ - user: one(user, { - fields: [actionToken.userId], - references: [user.id], - }), -})) diff --git a/app/db/schema/device.ts b/app/db/schema/device.ts index 022f77080..3707ae9ca 100644 --- a/app/db/schema/device.ts +++ b/app/db/schema/device.ts @@ -1,10 +1,5 @@ import { createId } from '@paralleldrive/cuid2' -import { - relations, - sql, - type InferInsertModel, - type InferSelectModel, -} from 'drizzle-orm' +import { sql, type InferInsertModel, type InferSelectModel } from 'drizzle-orm' import { pgTable, boolean, @@ -18,8 +13,6 @@ import { } from 'drizzle-orm/pg-core' import { DeviceExposureEnum, DeviceModelEnum, DeviceStatusEnum } from './enum' import { location } from './location' -import { logEntry } from './log-entry' -import { sensor } from './sensor' import { user } from './user' /** @@ -82,34 +75,6 @@ export const deviceToLocation = pgTable( }), ) -/** - * Relations - */ -export const deviceRelations = relations(device, ({ one, many }) => ({ - user: one(user, { - fields: [device.userId], - references: [user.id], - }), - sensors: many(sensor), - locations: many(deviceToLocation), - logEntries: many(logEntry), -})) - -// Many-to-many -export const deviceToLocationRelations = relations( - deviceToLocation, - ({ one }) => ({ - device: one(device, { - fields: [deviceToLocation.deviceId], - references: [device.id], - }), - geometry: one(location, { - fields: [deviceToLocation.locationId], - references: [location.id], - }), - }), -) - /** * Types */ diff --git a/app/db/schema/location.ts b/app/db/schema/location.ts index 51c7a4f5f..e4a9ad946 100644 --- a/app/db/schema/location.ts +++ b/app/db/schema/location.ts @@ -1,4 +1,4 @@ -import { relations, sql } from 'drizzle-orm' +import { sql } from 'drizzle-orm' import { bigserial, geometry, @@ -6,7 +6,6 @@ import { pgTable, unique, } from 'drizzle-orm/pg-core' -import { measurement } from './measurement' /** * Table @@ -30,11 +29,3 @@ export const location = pgTable( )`, ], ) - -/** - * Relations - * 1. One-to-many: Location - Measurement (One location can have many measurements) - */ -export const locationRelations = relations(location, ({ many }) => ({ - measurements: many(measurement), -})) diff --git a/app/db/schema/log-entry.ts b/app/db/schema/log-entry.ts index ff0aedc3b..1c5d90176 100644 --- a/app/db/schema/log-entry.ts +++ b/app/db/schema/log-entry.ts @@ -1,12 +1,7 @@ // log-entry.ts import { createId } from '@paralleldrive/cuid2' -import { - relations, - type InferInsertModel, - type InferSelectModel, -} from 'drizzle-orm' +import { type InferInsertModel, type InferSelectModel } from 'drizzle-orm' import { pgTable, text, timestamp, boolean } from 'drizzle-orm/pg-core' -import { device } from './device' // Table definition export const logEntry = pgTable('log_entry', { @@ -20,14 +15,6 @@ export const logEntry = pgTable('log_entry', { deviceId: text('device_id').notNull(), }) -// Relations definition -export const logEntryRelations = relations(logEntry, ({ one }) => ({ - device: one(device, { - fields: [logEntry.deviceId], - references: [device.id], - }), -})) - // Type exports export type LogEntry = InferSelectModel export type InsertLogEntry = InferInsertModel diff --git a/app/db/schema/measurement.ts b/app/db/schema/measurement.ts index e75f788b5..964035df8 100644 --- a/app/db/schema/measurement.ts +++ b/app/db/schema/measurement.ts @@ -1,4 +1,4 @@ -import { relations, type InferSelectModel } from 'drizzle-orm' +import { type InferSelectModel } from 'drizzle-orm' import { bigint, doublePrecision, @@ -31,17 +31,6 @@ export const measurement = pgTable( }), ) -/** - * Relations - * 1. One-to-many: One measurement could have exactly on location (mobile) or no location (stationary) - */ -export const measurementRelations = relations(measurement, ({ one }) => ({ - location: one(location, { - fields: [measurement.locationId], - references: [location.id], - }), -})) - /** * Views */ diff --git a/app/db/schema/profile.ts b/app/db/schema/profile.ts index 4ab3c7026..dec163d6c 100644 --- a/app/db/schema/profile.ts +++ b/app/db/schema/profile.ts @@ -1,9 +1,5 @@ import { createId } from '@paralleldrive/cuid2' -import { - relations, - type InferInsertModel, - type InferSelectModel, -} from 'drizzle-orm' +import { type InferInsertModel, type InferSelectModel } from 'drizzle-orm' import { pgTable, boolean, @@ -11,7 +7,6 @@ import { real, text, } from 'drizzle-orm/pg-core' -import { profileImage } from './profile-image' import { user } from './user' /** @@ -36,20 +31,6 @@ export const profile = pgTable('profile', { }), }) -/** - * Relations - */ -export const profileRelations = relations(profile, ({ one }) => ({ - user: one(user, { - fields: [profile.userId], - references: [user.id], - }), - profileImage: one(profileImage, { - fields: [profile.id], - references: [profileImage.profileId], - }), -})) - /** * Types */ diff --git a/app/db/schema/refreshToken.ts b/app/db/schema/refreshToken.ts index b37f1396a..ae4b84a4e 100644 --- a/app/db/schema/refreshToken.ts +++ b/app/db/schema/refreshToken.ts @@ -1,4 +1,4 @@ -import { relations, type InferSelectModel } from 'drizzle-orm' +import { type InferSelectModel } from 'drizzle-orm' import { json, pgTable, text, timestamp } from 'drizzle-orm/pg-core' import { user } from './user' @@ -12,13 +12,6 @@ export const refreshToken = pgTable('refresh_token', { expiresAt: timestamp('expires_at'), }) -export const refreshTokenRelations = relations(refreshToken, ({ one }) => ({ - user: one(user, { - fields: [refreshToken.userId], - references: [user.id], - }), -})) - export const tokenRevocation = pgTable('token_revocation', { hash: text('hash').notNull(), token: json('token').notNull(), diff --git a/app/db/schema/sensor.ts b/app/db/schema/sensor.ts index a86f60384..591845728 100644 --- a/app/db/schema/sensor.ts +++ b/app/db/schema/sensor.ts @@ -1,14 +1,10 @@ import { randomBytes } from 'crypto' import { createId } from '@paralleldrive/cuid2' -import { - relations, - type InferInsertModel, - type InferSelectModel, -} from 'drizzle-orm' +import { type InferInsertModel, type InferSelectModel } from 'drizzle-orm' import { pgTable, text, timestamp, json, integer } from 'drizzle-orm/pg-core' -import { device } from './device' import { DeviceStatusEnum } from './enum' import { type Measurement } from './measurement' +import { device } from './device' export function generateHexId(): string { return randomBytes(12).toString('hex') @@ -51,16 +47,6 @@ export const sensor = pgTable('sensor', { order: integer('order').default(0), }) -/** - * Relations - */ -export const sensorRelations = relations(sensor, ({ one }) => ({ - device: one(device, { - fields: [sensor.deviceId], - references: [device.id], - }), -})) - /** * Types */ diff --git a/app/db/schema/user.ts b/app/db/schema/user.ts index 7b1366cfa..d68152427 100644 --- a/app/db/schema/user.ts +++ b/app/db/schema/user.ts @@ -1,15 +1,6 @@ import { createId } from '@paralleldrive/cuid2' -import { - type InferInsertModel, - type InferSelectModel, - relations, -} from 'drizzle-orm' +import { type InferInsertModel, type InferSelectModel } from 'drizzle-orm' import { pgTable, boolean, text, timestamp } from 'drizzle-orm/pg-core' -import { actionToken } from './action-token' -import { device } from './device' -import { password } from './password' -import { profile } from './profile' -import { refreshToken } from './refreshToken' import { tosVersion } from './tos' import { themePreference } from './enum' @@ -39,23 +30,6 @@ export const user = pgTable('user', { acceptedTosAt: timestamp('accepted_tos_at', { withTimezone: true }), }) -/** - * Relations - */ -export const userRelations = relations(user, ({ one, many }) => ({ - password: one(password, { - fields: [user.id], - references: [password.userId], - }), - profile: one(profile, { - fields: [user.id], - references: [profile.userId], - }), - devices: many(device), - refreshToken: many(refreshToken), - actionTokens: many(actionToken), -})) - /** * Types */ From 1d1ba6181b8d745e404a43623a0d0d0340fbd454 Mon Sep 17 00:00:00 2001 From: jona159 Date: Wed, 22 Jul 2026 08:33:23 +0200 Subject: [PATCH 2/6] feat: install drizzle v1 rc --- package-lock.json | 596 ++++++++++------------------------------------ package.json | 4 +- 2 files changed, 129 insertions(+), 471 deletions(-) diff --git a/package-lock.json b/package-lock.json index d1da0cb6b..838b1ead7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -62,7 +62,7 @@ "cross-env": "^10.1.0", "date-fns": "^4.1.0", "dotenv": "^17.4.2", - "drizzle-orm": "^0.45.2", + "drizzle-orm": "^1.0.0-rc.4", "framer-motion": "^12.38.0", "get-user-locale": "^3.0.0", "glob": "^13.0.6", @@ -135,7 +135,7 @@ "@vitest/coverage-v8": "^4.1.6", "@vitest/ui": "^4.1.5", "csvtojson": "^2.0.14", - "drizzle-kit": "^0.31.10", + "drizzle-kit": "^1.0.0-rc.4", "jsdom": "^29.0.2", "msw": "^2.13.4", "npm-run-all": "^4.1.5", @@ -1306,9 +1306,9 @@ } }, "node_modules/@drizzle-team/brocli": { - "version": "0.10.2", - "resolved": "https://registry.npmjs.org/@drizzle-team/brocli/-/brocli-0.10.2.tgz", - "integrity": "sha512-z33Il7l5dKjUgGULTqBsQBQwckHh5AbIuxhdsIxDDiZAzBOrZO6q9ogcWC65kU382AfynTfgNumVcNIjuIua6w==", + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/@drizzle-team/brocli/-/brocli-0.12.0.tgz", + "integrity": "sha512-mlUE+rZ8CatQekLhnaiN91Iemdd+e2gFKooGlnRB3oPTL3VghLfX24dx7HrzMNeC1JrIB/0kpsfyty3f5HNfxQ==", "dev": true, "license": "Apache-2.0" }, @@ -1344,442 +1344,6 @@ "integrity": "sha512-lrTPqgvfFQtR/eY/qkIzp98OGdNJu0m5ji3q/nJI8v3SXkRKEnWiOxMmbvcSoAIzv/cGiuvRy57k4suKQSAdwA==", "license": "MIT" }, - "node_modules/@esbuild-kit/core-utils": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/@esbuild-kit/core-utils/-/core-utils-3.3.2.tgz", - "integrity": "sha512-sPRAnw9CdSsRmEtnsl2WXWdyquogVpB3yZ3dgwJfe8zrOzTsV7cJvmwrKVa+0ma5BoiGJ+BoqkMvawbayKUsqQ==", - "deprecated": "Merged into tsx: https://tsx.hirok.io", - "dev": true, - "license": "MIT", - "dependencies": { - "esbuild": "~0.18.20", - "source-map-support": "^0.5.21" - } - }, - "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/android-arm": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.18.20.tgz", - "integrity": "sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/android-arm64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.18.20.tgz", - "integrity": "sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/android-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.20.tgz", - "integrity": "sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/darwin-arm64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.18.20.tgz", - "integrity": "sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/darwin-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.18.20.tgz", - "integrity": "sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/freebsd-arm64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.18.20.tgz", - "integrity": "sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/freebsd-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.18.20.tgz", - "integrity": "sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/linux-arm": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.18.20.tgz", - "integrity": "sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/linux-arm64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.18.20.tgz", - "integrity": "sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/linux-ia32": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.18.20.tgz", - "integrity": "sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==", - "cpu": [ - "ia32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/linux-loong64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.18.20.tgz", - "integrity": "sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg==", - "cpu": [ - "loong64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/linux-mips64el": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.18.20.tgz", - "integrity": "sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ==", - "cpu": [ - "mips64el" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/linux-ppc64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.18.20.tgz", - "integrity": "sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA==", - "cpu": [ - "ppc64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/linux-riscv64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.18.20.tgz", - "integrity": "sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A==", - "cpu": [ - "riscv64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/linux-s390x": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.18.20.tgz", - "integrity": "sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==", - "cpu": [ - "s390x" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/linux-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.18.20.tgz", - "integrity": "sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/netbsd-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.18.20.tgz", - "integrity": "sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/openbsd-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.18.20.tgz", - "integrity": "sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/sunos-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.18.20.tgz", - "integrity": "sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "sunos" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/win32-arm64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.18.20.tgz", - "integrity": "sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/win32-ia32": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.18.20.tgz", - "integrity": "sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g==", - "cpu": [ - "ia32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/win32-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.18.20.tgz", - "integrity": "sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild-kit/core-utils/node_modules/esbuild": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.18.20.tgz", - "integrity": "sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==", - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "bin": { - "esbuild": "bin/esbuild" - }, - "engines": { - "node": ">=12" - }, - "optionalDependencies": { - "@esbuild/android-arm": "0.18.20", - "@esbuild/android-arm64": "0.18.20", - "@esbuild/android-x64": "0.18.20", - "@esbuild/darwin-arm64": "0.18.20", - "@esbuild/darwin-x64": "0.18.20", - "@esbuild/freebsd-arm64": "0.18.20", - "@esbuild/freebsd-x64": "0.18.20", - "@esbuild/linux-arm": "0.18.20", - "@esbuild/linux-arm64": "0.18.20", - "@esbuild/linux-ia32": "0.18.20", - "@esbuild/linux-loong64": "0.18.20", - "@esbuild/linux-mips64el": "0.18.20", - "@esbuild/linux-ppc64": "0.18.20", - "@esbuild/linux-riscv64": "0.18.20", - "@esbuild/linux-s390x": "0.18.20", - "@esbuild/linux-x64": "0.18.20", - "@esbuild/netbsd-x64": "0.18.20", - "@esbuild/openbsd-x64": "0.18.20", - "@esbuild/sunos-x64": "0.18.20", - "@esbuild/win32-arm64": "0.18.20", - "@esbuild/win32-ia32": "0.18.20", - "@esbuild/win32-x64": "0.18.20" - } - }, - "node_modules/@esbuild-kit/esm-loader": { - "version": "2.6.5", - "resolved": "https://registry.npmjs.org/@esbuild-kit/esm-loader/-/esm-loader-2.6.5.tgz", - "integrity": "sha512-FxEMIkJKnodyA1OaCUoEvbYRkoZlLZ4d/eXFu9Fh8CbBBgP5EmZxrfTRyN0qpXZ4vOvqnE5YdRdcrmUUXuU+dA==", - "deprecated": "Merged into tsx: https://tsx.hirok.io", - "dev": true, - "license": "MIT", - "dependencies": { - "@esbuild-kit/core-utils": "^3.3.2", - "get-tsconfig": "^4.7.0" - } - }, "node_modules/@esbuild/aix-ppc64": { "version": "0.28.1", "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.1.tgz", @@ -2929,6 +2493,19 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, + "node_modules/@js-temporal/polyfill": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/@js-temporal/polyfill/-/polyfill-0.5.1.tgz", + "integrity": "sha512-hloP58zRVCRSpgDxmqCWJNlizAlUgJFqG2ypq79DCvyv9tHjRYMDOcPFjzfl/A1/YxDvRCZz8wvZvmapQnKwFQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "jsbi": "^4.3.0" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/@kurkle/color": { "version": "0.3.4", "resolved": "https://registry.npmjs.org/@kurkle/color/-/color-0.3.4.tgz", @@ -10024,16 +9601,17 @@ } }, "node_modules/drizzle-kit": { - "version": "0.31.10", - "resolved": "https://registry.npmjs.org/drizzle-kit/-/drizzle-kit-0.31.10.tgz", - "integrity": "sha512-7OZcmQUrdGI+DUNNsKBn1aW8qSoKuTH7d0mYgSP8bAzdFzKoovxEFnoGQp2dVs82EOJeYycqRtciopszwUf8bw==", + "version": "1.0.0-rc.4", + "resolved": "https://registry.npmjs.org/drizzle-kit/-/drizzle-kit-1.0.0-rc.4.tgz", + "integrity": "sha512-KZCpjRyu+oYHLj/UJogfFlOkWhHVkaEI2EOT1U3NDVXUzLoTyPjqwFxwOrlQxsY6jzRyxcz4EacqboGfhEeYrA==", "dev": true, "license": "MIT", "dependencies": { - "@drizzle-team/brocli": "^0.10.2", - "@esbuild-kit/esm-loader": "^2.5.5", - "esbuild": "^0.25.4", - "tsx": "^4.21.0" + "@drizzle-team/brocli": "^0.12.0", + "@js-temporal/polyfill": "^0.5.1", + "esbuild": "^0.25.10", + "get-tsconfig": "^4.13.6", + "jiti": "^2.6.1" }, "bin": { "drizzle-kit": "bin.cjs" @@ -10524,13 +10102,22 @@ } }, "node_modules/drizzle-orm": { - "version": "0.45.2", - "resolved": "https://registry.npmjs.org/drizzle-orm/-/drizzle-orm-0.45.2.tgz", - "integrity": "sha512-kY0BSaTNYWnoDMVoyY8uxmyHjpJW1geOmBMdSSicKo9CIIWkSxMIj2rkeSR51b8KAPB7m+qysjuHme5nKP+E5Q==", + "version": "1.0.0-rc.4", + "resolved": "https://registry.npmjs.org/drizzle-orm/-/drizzle-orm-1.0.0-rc.4.tgz", + "integrity": "sha512-BT+pf+qoiYHqltoA88Jmf6ilGMXPlpfE0hEJKc2adRtMCAl25Swk/t5gXcWxZNAwdtf3F5gCd2FpeOyP/pT0Hw==", "license": "Apache-2.0", "peerDependencies": { "@aws-sdk/client-rds-data": ">=3", "@cloudflare/workers-types": ">=4", + "@effect/sql-d1": ">=4.0.0-beta.83 || >=4.0.0", + "@effect/sql-libsql": ">=4.0.0-beta.83 || >=4.0.0", + "@effect/sql-mysql2": ">=4.0.0-beta.83 || >=4.0.0", + "@effect/sql-pg": ">=4.0.0-beta.83 || >=4.0.0", + "@effect/sql-pglite": ">=4.0.0-beta.83 || >=4.0.0", + "@effect/sql-sqlite-bun": ">=4.0.0-beta.83 || >=4.0.0", + "@effect/sql-sqlite-do": ">=4.0.0-beta.83 || >=4.0.0", + "@effect/sql-sqlite-node": ">=4.0.0-beta.83 || >=4.0.0", + "@effect/sql-sqlite-wasm": ">=4.0.0-beta.83 || >=4.0.0", "@electric-sql/pglite": ">=0.2.0", "@libsql/client": ">=0.10.0", "@libsql/client-wasm": ">=0.10.0", @@ -10538,25 +10125,35 @@ "@op-engineering/op-sqlite": ">=2", "@opentelemetry/api": "^1.4.1", "@planetscale/database": ">=1.13", - "@prisma/client": "*", + "@sinclair/typebox": ">=0.34.8", + "@sqlitecloud/drivers": ">=1.0.653", "@tidbcloud/serverless": "*", + "@tursodatabase/database": ">=0.6.0-pre.28 || >=0.6.0", + "@tursodatabase/database-common": ">=0.6.0-pre.28 || >=0.6.0", + "@tursodatabase/database-wasm": ">=0.6.0-pre.28 || >=0.6.0", + "@tursodatabase/serverless": ">=1.1.3", + "@tursodatabase/sync": ">=0.6.0-pre.28 || >=0.6.0", "@types/better-sqlite3": "*", + "@types/mssql": "^9.1.4", "@types/pg": "*", "@types/sql.js": "*", "@upstash/redis": ">=1.34.7", "@vercel/postgres": ">=0.8.0", "@xata.io/client": "*", - "better-sqlite3": ">=7", + "arktype": ">=2.0.0", + "better-sqlite3": ">=9.3.0", "bun-types": "*", + "effect": ">=4.0.0-beta.83 || >=4.0.0", "expo-sqlite": ">=14.0.0", - "gel": ">=2", - "knex": "*", - "kysely": "*", + "mssql": "^11.0.1", "mysql2": ">=2", "pg": ">=8", "postgres": ">=3", "sql.js": ">=1", - "sqlite3": ">=5" + "sqlite3": ">=5", + "typebox": ">=1.0.0", + "valibot": ">=1.0.0-beta.7", + "zod": "^3.25.0 || ^4.0.0" }, "peerDependenciesMeta": { "@aws-sdk/client-rds-data": { @@ -10565,6 +10162,33 @@ "@cloudflare/workers-types": { "optional": true }, + "@effect/sql-d1": { + "optional": true + }, + "@effect/sql-libsql": { + "optional": true + }, + "@effect/sql-mysql2": { + "optional": true + }, + "@effect/sql-pg": { + "optional": true + }, + "@effect/sql-pglite": { + "optional": true + }, + "@effect/sql-sqlite-bun": { + "optional": true + }, + "@effect/sql-sqlite-do": { + "optional": true + }, + "@effect/sql-sqlite-node": { + "optional": true + }, + "@effect/sql-sqlite-wasm": { + "optional": true + }, "@electric-sql/pglite": { "optional": true }, @@ -10586,15 +10210,36 @@ "@planetscale/database": { "optional": true }, - "@prisma/client": { + "@sinclair/typebox": { + "optional": true + }, + "@sqlitecloud/drivers": { "optional": true }, "@tidbcloud/serverless": { "optional": true }, + "@tursodatabase/database": { + "optional": true + }, + "@tursodatabase/database-common": { + "optional": true + }, + "@tursodatabase/database-wasm": { + "optional": true + }, + "@tursodatabase/serverless": { + "optional": true + }, + "@tursodatabase/sync": { + "optional": true + }, "@types/better-sqlite3": { "optional": true }, + "@types/mssql": { + "optional": true + }, "@types/pg": { "optional": true }, @@ -10610,22 +10255,22 @@ "@xata.io/client": { "optional": true }, - "better-sqlite3": { + "arktype": { "optional": true }, - "bun-types": { + "better-sqlite3": { "optional": true }, - "expo-sqlite": { + "bun-types": { "optional": true }, - "gel": { + "effect": { "optional": true }, - "knex": { + "expo-sqlite": { "optional": true }, - "kysely": { + "mssql": { "optional": true }, "mysql2": { @@ -10637,14 +10282,20 @@ "postgres": { "optional": true }, - "prisma": { - "optional": true - }, "sql.js": { "optional": true }, "sqlite3": { "optional": true + }, + "typebox": { + "optional": true + }, + "valibot": { + "optional": true + }, + "zod": { + "optional": true } } }, @@ -12802,6 +12453,13 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/jsbi": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/jsbi/-/jsbi-4.3.2.tgz", + "integrity": "sha512-9fqMSQbhJykSeii05nxKl4m6Eqn2P6rOlYiS+C5Dr/HPIU/7yZxu5qzbs40tgaFORiw2Amd0mirjxatXYMkIew==", + "dev": true, + "license": "Apache-2.0" + }, "node_modules/jsdom": { "version": "29.1.1", "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-29.1.1.tgz", @@ -17653,7 +17311,6 @@ "integrity": "sha512-GQHnkIfxyx1wYCOS/wonik5MVRZU9hi1TEZmzGZSCJB1y9YgoZ8H6itNE/u4suE+yLmOzuE4E5S4TZ/ZX2wcWQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "esbuild": "~0.28.0" }, @@ -18073,8 +17730,9 @@ "version": "1.4.2", "resolved": "https://registry.npmjs.org/valibot/-/valibot-1.4.2.tgz", "integrity": "sha512-gjdCvJ6d3RyHAneqxMYMW9QMCwYMb3jpOO0IyHZV1bnRHFBHrX3VkIILt5XYR0WhwHiH7Mty8ovuPZ/O3gamrg==", - "dev": true, + "devOptional": true, "license": "MIT", + "peer": true, "peerDependencies": { "typescript": ">=5" }, diff --git a/package.json b/package.json index 87735d9e6..9d5e138ad 100644 --- a/package.json +++ b/package.json @@ -86,7 +86,7 @@ "cross-env": "^10.1.0", "date-fns": "^4.1.0", "dotenv": "^17.4.2", - "drizzle-orm": "^0.45.2", + "drizzle-orm": "^1.0.0-rc.4", "framer-motion": "^12.38.0", "get-user-locale": "^3.0.0", "glob": "^13.0.6", @@ -159,7 +159,7 @@ "@vitest/coverage-v8": "^4.1.6", "@vitest/ui": "^4.1.5", "csvtojson": "^2.0.14", - "drizzle-kit": "^0.31.10", + "drizzle-kit": "^1.0.0-rc.4", "jsdom": "^29.0.2", "msw": "^2.13.4", "npm-run-all": "^4.1.5", From 9b45998dec488fcd42ca3295cde49b2435c1ed2c Mon Sep 17 00:00:00 2001 From: jona159 Date: Wed, 22 Jul 2026 08:37:49 +0200 Subject: [PATCH 3/6] feat: replace callbacks with v2 filter objects --- app/db/models/device.server.ts | 95 +++++++------------ app/db/models/integration.server.ts | 7 +- app/db/models/measurement.query.server.ts | 24 +++-- app/db/models/measurement.server.ts | 24 +++-- app/db/models/profile.server.ts | 29 ++---- app/db/models/sensor.server.ts | 8 +- app/db/models/token.server.ts | 13 ++- app/db/models/tos.server.ts | 35 ++++--- app/db/models/transfer.server.ts | 2 +- app/db/models/user.server.ts | 16 ++-- app/lib/jwt.ts | 2 +- app/routes/api.integrations.schema.$slug.ts | 2 +- ...device.$deviceId.edit.$integrationSlug.tsx | 4 +- app/routes/resources.file.$fileId.tsx | 3 +- app/routes/settings.profile.photo.tsx | 2 +- app/services/newsletter-service.server.ts | 5 +- app/services/user-service.server.ts | 26 +++-- 17 files changed, 124 insertions(+), 173 deletions(-) diff --git a/app/db/models/device.server.ts b/app/db/models/device.server.ts index 0001975b5..95a2ac99f 100644 --- a/app/db/models/device.server.ts +++ b/app/db/models/device.server.ts @@ -8,15 +8,13 @@ import { and, between, isNull, - type ExtractTablesWithRelations, isNotNull, type SQL, gte, lt, exists, } from 'drizzle-orm' -import { alias, type PgTransaction } from 'drizzle-orm/pg-core' -import { type PostgresJsQueryResultHKT } from 'drizzle-orm/postgres-js' +import { alias } from 'drizzle-orm/pg-core' import { type Point } from 'geojson' import { device, @@ -28,8 +26,7 @@ import { type Device, type Sensor, } from '~/db/schema' -import type * as schema from '~/db/schema/index' -import { drizzleClient } from '~/db.server' +import { drizzleClient, type DrizzleTransaction } from '~/db.server' import BaseNewDeviceEmail, { messages as BaseNewDeviceMessages, } from '~/emails/base-new-device' @@ -102,7 +99,7 @@ export function assertDeviceIsMutable( export function getDevice({ id }: Pick) { return drizzleClient.query.device.findFirst({ - where: (device, { eq }) => eq(device.id, id), + where: { id }, columns: BASE_DEVICE_COLUMNS, with: { user: { @@ -111,7 +108,7 @@ export function getDevice({ id }: Pick) { }, }, logEntries: { - where: (entry, { eq }) => eq(entry.public, true), + where: { public: true }, columns: { id: true, content: true, @@ -121,26 +118,18 @@ export function getDevice({ id }: Pick) { }, }, locations: { - // https://github.com/drizzle-team/drizzle-orm/pull/2778 - // with: { - // geometry: true - // }, columns: { - // time: true, - }, - extras: { - time: sql`time`.as('time'), + time: true, }, with: { geometry: { columns: {}, extras: { - x: sql`ST_X(${location.location})`.as('x'), - y: sql`ST_Y(${location.location})`.as('y'), + x: (location) => sql`ST_X(${location.location})`.as('x'), + y: (location) => sql`ST_Y(${location.location})`.as('y'), }, }, }, - // limit: 1000, }, sensors: true, }, @@ -157,7 +146,7 @@ export type DeviceForSingleMeasurementWrite = Awaited< export function getDeviceForMeasurementWrite({ id }: Pick) { return drizzleClient.query.device.findFirst({ - where: (device, { eq }) => eq(device.id, id), + where: { id }, columns: { id: true, archivedAt: true, @@ -209,7 +198,7 @@ export async function getDeviceForSingleMeasurementWrite({ export function getUserDevice({ id, userId }: Pick) { return drizzleClient.query.device.findFirst({ - where: (d, { and, eq }) => and(eq(d.id, id), eq(d.userId, userId)), + where: { id, userId }, columns: { id: true, name: true, @@ -249,7 +238,7 @@ export function getLocations( } export function getDeviceWithoutSensors({ id }: Pick) { return drizzleClient.query.device.findFirst({ - where: (device, { eq }) => eq(device.id, id), + where: { id }, columns: { id: true, name: true, @@ -536,7 +525,7 @@ export function deleteDevice({ id }: Pick) { export function getUserDevices(userId: Device['userId']) { return drizzleClient.query.device.findMany({ - where: (device, { eq }) => eq(device.userId, userId), + where: { userId }, columns: DEVICE_COLUMNS_WITH_SENSORS, with: { sensors: true, @@ -546,8 +535,7 @@ export function getUserDevices(userId: Device['userId']) { export function getUserDeviceLocations(userId: Device['userId']) { return drizzleClient.query.device.findMany({ - where: (device, { and, eq, isNull }) => - and(eq(device.userId, userId), isNull(device.archivedAt)), + where: { userId, archivedAt: { isNull: true } }, columns: { id: true, latitude: true, @@ -559,7 +547,7 @@ export function getUserDeviceLocations(userId: Device['userId']) { export function getUserDeviceIds(userId: Device['userId']) { return drizzleClient.query.device .findMany({ - where: (device, { eq }) => eq(device.userId, userId), + where: { userId }, columns: { id: true }, }) .then((d) => d.map((d) => d.id)) @@ -577,7 +565,7 @@ export async function getDevices( export async function getDevices(format: DevicesFormat = 'json') { const devices = await drizzleClient.query.device.findMany({ - where: (device) => isNull(device.archivedAt), + where: { archivedAt: { isNull: true } }, columns: { id: true, name: true, @@ -610,7 +598,7 @@ export async function getDevices(format: DevicesFormat = 'json') { export async function getArchivedDevices() { const devices = await drizzleClient.query.device.findMany({ - where: (device) => isNotNull(device.archivedAt), + where: { archivedAt: { isNotNull: true } }, columns: { id: true, name: true, @@ -742,7 +730,7 @@ export interface FindDevicesOptions extends BuildWhereClauseOptions { interface WhereClauseResult { includeColumns: Record - whereClause: any[] + whereClause: Array<(table: typeof device) => SQL> } const buildWhereClause = function buildWhereClause( @@ -758,20 +746,18 @@ const buildWhereClause = function buildWhereClause( maxDistance, grouptag, } = opts - const clause = [] + const clause: Array<(table: typeof device) => SQL> = [] const columns = {} if (name) { - clause.push(ilike(device.name, `%${name}%`)) + clause.push((table) => ilike(table.name, `%${name}%`)) } if (phenomenon) { // @ts-ignore columns['sensors'] = { // @ts-ignore - where: (sensor, { ilike }) => - // @ts-ignore - ilike(sensorTable['title'], `%${phenomenon}%`), + where: { title: { ilike: `%${phenomenon}%` } }, } } @@ -783,7 +769,7 @@ const buildWhereClause = function buildWhereClause( // } if (grouptag) { - clause.push(arrayContains(device.tags, grouptag)) + clause.push((table) => arrayContains(table.tags, grouptag)) } // https://orm.drizzle.team/learn/guides/postgis-geometry-point @@ -791,17 +777,17 @@ const buildWhereClause = function buildWhereClause( const [latSW, lngSW] = bbox.coordinates[0][0] const [latNE, lngNE] = bbox.coordinates[0][2] clause.push( - sql`ST_Contains( + (table) => sql`ST_Contains( ST_MakeEnvelope(${lngSW}, ${latSW}, ${lngNE}, ${latNE}, 4326), - ST_SetSRID(ST_MakePoint(${device.longitude}, ${device.latitude}), 4326) + ST_SetSRID(ST_MakePoint(${table.longitude}, ${table.latitude}), 4326) )`, ) } if (near && maxDistance !== undefined) { clause.push( - sql`ST_DWithin( - ST_SetSRID(ST_MakePoint(${device.longitude}, ${device.latitude}), 4326)::geography, + (table) => sql`ST_DWithin( + ST_SetSRID(ST_MakePoint(${table.longitude}, ${table.latitude}), 4326)::geography, ST_SetSRID(ST_MakePoint(${near[1]}, ${near[0]}), 4326)::geography, ${maxDistance} )`, @@ -811,22 +797,13 @@ const buildWhereClause = function buildWhereClause( if (phenomenon && (fromDate || toDate)) { // @ts-ignore columns['sensors'] = { - include: { + with: { measurements: { - where: (measurement: any) => { - const conditions = [] - - if (fromDate && toDate) { - conditions.push( - sql`${measurement.createdAt} BETWEEN ${fromDate} AND ${toDate}`, - ) - } else if (fromDate) { - conditions.push(sql`${measurement.createdAt} >= ${fromDate}`) - } else if (toDate) { - conditions.push(sql`${measurement.createdAt} <= ${toDate}`) - } - - return and(...conditions) + where: { + time: { + ...(fromDate && { gte: fromDate }), + ...(toDate && { lte: toDate }), + }, }, }, }, @@ -852,7 +829,7 @@ const DEFAULT_COLUMNS = { name: true, model: true, exposure: true, - grouptag: true, + tags: true, image: true, description: true, link: true, @@ -878,7 +855,9 @@ export async function findDevices( ...(Object.keys(columns).length !== 0 && { columns }), ...(Object.keys(relations).length !== 0 && { with: relations }), ...(Object.keys(whereClause).length !== 0 && { - where: (_, { and }) => and(...whereClause), + where: { + RAW: (table) => and(...whereClause.map((clause) => clause(table)))!, + }, }), limit, }) @@ -1088,11 +1067,7 @@ export async function getLatestDevices() { export async function addOrReplaceDeviceApiKey( d: Device, - tx?: PgTransaction< - PostgresJsQueryResultHKT, - typeof schema, - ExtractTablesWithRelations - >, + tx?: DrizzleTransaction, ): Promise<{ apiKey: string }> { const { key } = await createDeviceApiKey(d) const result = await (tx ?? drizzleClient) diff --git a/app/db/models/integration.server.ts b/app/db/models/integration.server.ts index e97e55d8d..e5c4a43c7 100644 --- a/app/db/models/integration.server.ts +++ b/app/db/models/integration.server.ts @@ -1,16 +1,15 @@ -import { asc, eq } from 'drizzle-orm' -import { type Integration, integration } from '~/db/schema/integration' +import { type Integration } from '~/db/schema/integration' import { drizzleClient } from '~/db.server' export async function getIntegrations() { return drizzleClient.query.integration.findMany({ - orderBy: [asc(integration.order)], + orderBy: { order: 'asc' }, }) } export async function getIntegrationById({ id }: Pick) { return drizzleClient.query.integration.findFirst({ - where: eq(integration.id, id), + where: { id }, }) } diff --git a/app/db/models/measurement.query.server.ts b/app/db/models/measurement.query.server.ts index 710fb7c96..0fd06dc3b 100644 --- a/app/db/models/measurement.query.server.ts +++ b/app/db/models/measurement.query.server.ts @@ -83,13 +83,11 @@ export function getMeasurement( } // If aggregation is not specified or different from "15m" and "1d", fetch default measurements. return drizzleClient.query.measurement.findMany({ - where: (measurement, { eq, gte, lte }) => - and( - eq(measurement.sensorId, sensorId), - gte(measurement.time, startDate), - lte(measurement.time, endDate), - ), - orderBy: [desc(measurement.time)], + where: { + sensorId, + time: { gte: startDate, lte: endDate }, + }, + orderBy: { time: 'desc' }, with: { location: { // https://github.com/drizzle-team/drizzle-orm/pull/2778 @@ -100,8 +98,8 @@ export function getMeasurement( id: true, }, extras: { - x: sql`ST_X(${location.location})`.as('x'), - y: sql`ST_Y(${location.location})`.as('y'), + x: (location) => sql`ST_X(${location.location})`.as('x'), + y: (location) => sql`ST_Y(${location.location})`.as('y'), }, }, }, @@ -143,8 +141,8 @@ export function getMeasurement( // If neither start date nor aggregation are specified, fetch default measurements with a limit of 20000. return drizzleClient.query.measurement.findMany({ - where: (measurement, { eq }) => eq(measurement.sensorId, sensorId), - orderBy: [desc(measurement.time)], + where: { sensorId }, + orderBy: { time: 'desc' }, with: { location: { // https://github.com/drizzle-team/drizzle-orm/pull/2778 @@ -155,8 +153,8 @@ export function getMeasurement( id: true, }, extras: { - x: sql`ST_X(${location.location})`.as('x'), - y: sql`ST_Y(${location.location})`.as('y'), + x: (location) => sql`ST_X(${location.location})`.as('x'), + y: (location) => sql`ST_Y(${location.location})`.as('y'), }, }, }, diff --git a/app/db/models/measurement.server.ts b/app/db/models/measurement.server.ts index 4a4862b7b..7dd831eaf 100644 --- a/app/db/models/measurement.server.ts +++ b/app/db/models/measurement.server.ts @@ -96,13 +96,11 @@ export function getMeasurement( } // If aggregation is not specified or different from "15m" and "1d", fetch default measurements. return drizzleClient.query.measurement.findMany({ - where: (measurement, { eq, gte, lte }) => - and( - eq(measurement.sensorId, sensorId), - gte(measurement.time, startDate), - lte(measurement.time, endDate), - ), - orderBy: [desc(measurement.time)], + where: { + sensorId, + time: { gte: startDate, lte: endDate }, + }, + orderBy: { time: 'desc' }, with: { location: { // https://github.com/drizzle-team/drizzle-orm/pull/2778 @@ -113,8 +111,8 @@ export function getMeasurement( id: true, }, extras: { - x: sql`ST_X(${location.location})`.as('x'), - y: sql`ST_Y(${location.location})`.as('y'), + x: (location) => sql`ST_X(${location.location})`.as('x'), + y: (location) => sql`ST_Y(${location.location})`.as('y'), }, }, }, @@ -156,8 +154,8 @@ export function getMeasurement( // If neither start date nor aggregation are specified, fetch default measurements with a limit of 20000. return drizzleClient.query.measurement.findMany({ - where: (measurement, { eq }) => eq(measurement.sensorId, sensorId), - orderBy: [desc(measurement.time)], + where: { sensorId }, + orderBy: { time: 'desc' }, with: { location: { // https://github.com/drizzle-team/drizzle-orm/pull/2778 @@ -168,8 +166,8 @@ export function getMeasurement( id: true, }, extras: { - x: sql`ST_X(${location.location})`.as('x'), - y: sql`ST_Y(${location.location})`.as('y'), + x: (location) => sql`ST_X(${location.location})`.as('x'), + y: (location) => sql`ST_Y(${location.location})`.as('y'), }, }, }, diff --git a/app/db/models/profile.server.ts b/app/db/models/profile.server.ts index 1ea30d30b..a6269775f 100644 --- a/app/db/models/profile.server.ts +++ b/app/db/models/profile.server.ts @@ -1,19 +1,11 @@ -import { - eq, - type ExtractTablesWithRelations, - count, - inArray, -} from 'drizzle-orm' -import { type PgTransaction } from 'drizzle-orm/pg-core' -import { type PostgresJsQueryResultHKT } from 'drizzle-orm/postgres-js' +import { eq, count, inArray } from 'drizzle-orm' import { type User, type Profile, profile, measurement } from '~/db/schema' -import type * as schema from '~/db/schema' -import { drizzleClient } from '~/db.server' +import { drizzleClient, type DrizzleTransaction } from '~/db.server' import { formatCount } from '~/lib/numbers' export async function getProfileByUserId(userId: User['id']) { return drizzleClient.query.profile.findFirst({ - where: (profile, { eq }) => eq(profile.userId, userId), + where: { userId }, with: { profileImage: true, user: { @@ -27,7 +19,7 @@ export async function getProfileByUserId(userId: User['id']) { export async function getProfileByUsername(username: string) { const userRecord = await drizzleClient.query.user.findFirst({ - where: (u, { eq }) => eq(u.name, username), + where: { name: username }, }) if (!userRecord) return null return getProfileByUserId(userRecord.id) @@ -49,7 +41,8 @@ export async function updateProfile( } if ('homeLatitude' in values) updateValues.homeLatitude = values.homeLatitude - if ('homeLongitude' in values) updateValues.homeLongitude = values.homeLongitude + if ('homeLongitude' in values) + updateValues.homeLongitude = values.homeLongitude if ('homeZoom' in values) updateValues.homeZoom = values.homeZoom const [updatedProfile] = await drizzleClient @@ -71,11 +64,7 @@ export async function createProfile( } export async function createProfileWithTransaction( - transaction: PgTransaction< - PostgresJsQueryResultHKT, - typeof schema, - ExtractTablesWithRelations - >, + transaction: DrizzleTransaction, userId: User['id'], displayName: Profile['displayName'], ) { @@ -92,7 +81,7 @@ export async function getProfileSensorsAndMeasurementsCount(profile: Profile) { if (userId == null) return { sensorsCount: '0', measurementsCount: '0' } const devices = await drizzleClient.query.device.findMany({ - where: (device, { eq }) => eq(device.userId, userId), + where: { userId }, }) const deviceIds = devices.map((device) => device.id) @@ -102,7 +91,7 @@ export async function getProfileSensorsAndMeasurementsCount(profile: Profile) { // Get sensor IDs for measurements count const sensors = await drizzleClient.query.sensor.findMany({ - where: (s, { inArray }) => inArray(s.deviceId, deviceIds), + where: { deviceId: { in: deviceIds } }, columns: { id: true }, }) const sensorsCount = sensors.length diff --git a/app/db/models/sensor.server.ts b/app/db/models/sensor.server.ts index 9f9c2633c..97d40233a 100644 --- a/app/db/models/sensor.server.ts +++ b/app/db/models/sensor.server.ts @@ -13,7 +13,7 @@ import { type BoxesDataQueryParams } from '~/lib/api-schemas/boxes-data-query-sc export function getSensors(deviceId: Sensor['deviceId']) { return drizzleClient.query.sensor.findMany({ - where: (sensor, { eq }) => eq(sensor.deviceId, deviceId), + where: { deviceId }, }) // const geojson: GeoJSON.FeatureCollection = { @@ -68,8 +68,8 @@ export function getSensors(deviceId: Sensor['deviceId']) { export function getSensorsFromDevice(deviceId: Sensor['deviceId']) { return drizzleClient.query.sensor.findMany({ - where: (sensor, { eq }) => eq(sensor.deviceId, deviceId), - orderBy: (sensor, { asc }) => [asc(sensor.order)], + where: { deviceId }, + orderBy: { order: 'asc' }, }) } @@ -212,7 +212,7 @@ export function updateSensor({ // return first sensor with its device name export function getSensor(id: Sensor['id']) { return drizzleClient.query.sensor.findFirst({ - where: (sensor, { eq }) => eq(sensor.id, id), + where: { id }, }) } diff --git a/app/db/models/token.server.ts b/app/db/models/token.server.ts index 792078149..1d84a1e2d 100644 --- a/app/db/models/token.server.ts +++ b/app/db/models/token.server.ts @@ -1,5 +1,5 @@ import { createHash, randomBytes } from 'node:crypto' -import { and, eq, gt } from 'drizzle-orm' +import { and, eq } from 'drizzle-orm' import { actionToken } from '~/db/schema' import { drizzleClient } from '~/db.server' @@ -62,12 +62,11 @@ export async function issueNewsletterConfirmationToken(userId: string) { export async function hasPendingNewsletterConfirmationToken(userId: string) { const token = await drizzleClient.query.actionToken.findFirst({ - where: (t) => - and( - eq(t.userId, userId), - eq(t.purpose, 'newsletter_confirmation'), - gt(t.expiresAt, new Date()), - ), + where: { + userId, + purpose: 'newsletter_confirmation', + expiresAt: { gt: new Date() }, + }, }) return Boolean(token) diff --git a/app/db/models/tos.server.ts b/app/db/models/tos.server.ts index 44e3cccfd..1259eca52 100644 --- a/app/db/models/tos.server.ts +++ b/app/db/models/tos.server.ts @@ -6,15 +6,14 @@ import { drizzleClient } from '~/db.server' export async function getCurrentEffectiveTos(now = new Date()) { return drizzleClient.query.tosVersion.findFirst({ - where: (t, { lte }) => lte(t.effectiveFrom, now), - orderBy: (t, { desc }) => [desc(t.effectiveFrom)], + where: { effectiveFrom: { lte: now } }, + orderBy: { effectiveFrom: 'desc' }, }) } async function getUserAcceptance(userId: string, tosVersionId: string) { return drizzleClient.query.tosUserState.findFirst({ - where: (s, { and, eq }) => - and(eq(s.userId, userId), eq(s.tosVersionId, tosVersionId)), + where: { userId, tosVersionId }, columns: { acceptedAt: true }, }) } @@ -105,12 +104,11 @@ export async function getValidTosAcceptanceToken( const tokenHash = hashActionToken(rawToken) return drizzleClient.query.actionToken.findFirst({ - where: (t, { and, eq, gt, isNull }) => - and( - eq(t.purpose, 'tos_acceptance'), - eq(t.tokenHash, tokenHash), - gt(t.expiresAt, now), - ), + where: { + purpose: 'tos_acceptance', + tokenHash, + expiresAt: { gt: now }, + }, }) } @@ -120,13 +118,12 @@ export async function getActiveTosAcceptanceTokenById( now = new Date(), ) { return drizzleClient.query.actionToken.findFirst({ - where: (t, { and, eq, gt, isNull }) => - and( - eq(t.id, tokenId), - eq(t.userId, userId), - eq(t.purpose, 'tos_acceptance'), - gt(t.expiresAt, now), - ), + where: { + id: tokenId, + userId, + purpose: 'tos_acceptance', + expiresAt: { gt: now }, + }, }) } @@ -155,8 +152,8 @@ export async function acceptCurrentTosViaEmailFlow({ if (consumed.length === 0) return 'forbidden' const current = await tx.query.tosVersion.findFirst({ - where: (t, { lte }) => lte(t.effectiveFrom, now), - orderBy: (t, { desc }) => [desc(t.effectiveFrom)], + where: { effectiveFrom: { lte: now } }, + orderBy: { effectiveFrom: 'desc' }, }) if (!current) return 'not_configured' diff --git a/app/db/models/transfer.server.ts b/app/db/models/transfer.server.ts index 1f4a07416..707cb8819 100644 --- a/app/db/models/transfer.server.ts +++ b/app/db/models/transfer.server.ts @@ -51,7 +51,7 @@ export const generateTransferCode = (): string => { export function getTransfer({ id }: Pick) { return drizzleClient.query.claim.findFirst({ - where: (claim, { eq }) => eq(claim.boxId, id), + where: { boxId: id }, }) } diff --git a/app/db/models/user.server.ts b/app/db/models/user.server.ts index c7fbbcc27..a3a9e7838 100644 --- a/app/db/models/user.server.ts +++ b/app/db/models/user.server.ts @@ -15,19 +15,19 @@ import { ThemePreference } from '~/lib/theme' export async function getUserById(id: User['id']) { return drizzleClient.query.user.findFirst({ - where: (user, { eq }) => eq(user.id, id), + where: { id }, }) } export async function getUserByEmail(email: User['email']) { return drizzleClient.query.user.findFirst({ - where: (user, { eq }) => eq(user.email, email), + where: { email }, }) } export async function getUserByUnconfirmedEmail(unconfirmedEmail: string) { return drizzleClient.query.user.findFirst({ - where: (user, { eq }) => eq(user.unconfirmedEmail, unconfirmedEmail), + where: { unconfirmedEmail }, }) } @@ -36,14 +36,13 @@ export async function getUserByUnconfirmedEmail(unconfirmedEmail: string) { */ export async function getUserByAnyEmail(email: User['email']) { return drizzleClient.query.user.findFirst({ - where: (user, { eq, or }) => - or(eq(user.email, email), eq(user.unconfirmedEmail, email)), + where: { OR: [{ email }, { unconfirmedEmail: email }] }, }) } export async function getUserByUsername(username: User['name']) { return drizzleClient.query.user.findFirst({ - where: (user, { eq }) => eq(user.name, username), + where: { name: username }, }) } @@ -281,8 +280,9 @@ export async function verifyLogin(identifier: string, password: string) { const trimmedIdentifier = identifier.trim() const userWithPassword = await drizzleClient.query.user.findFirst({ - where: (user, { eq, or }) => - or(eq(user.email, trimmedIdentifier), eq(user.name, trimmedIdentifier)), + where: { + OR: [{ email: trimmedIdentifier }, { name: trimmedIdentifier }], + }, with: { profile: true, password: true, diff --git a/app/lib/jwt.ts b/app/lib/jwt.ts index ef11787f1..f04cb7040 100644 --- a/app/lib/jwt.ts +++ b/app/lib/jwt.ts @@ -253,7 +253,7 @@ export const refreshJwt = async ( ): Promise<{ token: string; refreshToken: string } | null> => { // We have to check if the refresh token actually belongs to the user const userForToken = await drizzleClient.query.refreshToken.findFirst({ - where: (r, { eq }) => eq(r.token, refreshToken), + where: { token: refreshToken }, with: { user: true, }, diff --git a/app/routes/api.integrations.schema.$slug.ts b/app/routes/api.integrations.schema.$slug.ts index 149cd8686..8653bdef3 100644 --- a/app/routes/api.integrations.schema.$slug.ts +++ b/app/routes/api.integrations.schema.$slug.ts @@ -12,7 +12,7 @@ export async function loader({ params }: Route.LoaderArgs) { try { const intg = await drizzleClient.query.integration.findFirst({ - where: eq(integration.slug, slug), + where: { slug }, }) if (!intg) { diff --git a/app/routes/device.$deviceId.edit.$integrationSlug.tsx b/app/routes/device.$deviceId.edit.$integrationSlug.tsx index 3429aefb2..10ea19d76 100644 --- a/app/routes/device.$deviceId.edit.$integrationSlug.tsx +++ b/app/routes/device.$deviceId.edit.$integrationSlug.tsx @@ -29,7 +29,7 @@ export async function loader({ request, params }: Route.LoaderArgs) { // Get integration config from DB const intg = await drizzleClient.query.integration.findFirst({ - where: eq(integration.slug, integrationSlug), + where: { slug: integrationSlug }, }) if (!intg) { @@ -99,7 +99,7 @@ export async function action({ request, params }: Route.ActionArgs) { // Get integration config from DB const intg = await drizzleClient.query.integration.findFirst({ - where: eq(integration.slug, integrationSlug), + where: { slug: integrationSlug }, }) if (!intg) { diff --git a/app/routes/resources.file.$fileId.tsx b/app/routes/resources.file.$fileId.tsx index 04c63a4b3..049419b3a 100644 --- a/app/routes/resources.file.$fileId.tsx +++ b/app/routes/resources.file.$fileId.tsx @@ -7,8 +7,7 @@ export async function loader({ params }: Route.LoaderArgs) { // Keep it as a string - your ID column is PgText, not an integer const image = await drizzleClient.query.profileImage.findFirst({ - where: (profileImage, { eq }) => - eq(profileImage.id, params.fileId as string), + where: { id: params.fileId as string }, }) if (!image || !image.blob) { diff --git a/app/routes/settings.profile.photo.tsx b/app/routes/settings.profile.photo.tsx index 4b2652226..93eb8b062 100644 --- a/app/routes/settings.profile.photo.tsx +++ b/app/routes/settings.profile.photo.tsx @@ -87,7 +87,7 @@ export async function action({ request }: Route.ActionArgs) { // Query user profile const previousProfileWithImage = await drizzleClient.query.profile.findFirst({ - where: (profile, { eq }) => eq(profile.userId, userId), + where: { userId }, with: { profileImage: true }, }) diff --git a/app/services/newsletter-service.server.ts b/app/services/newsletter-service.server.ts index 0b904df2d..493503b18 100644 --- a/app/services/newsletter-service.server.ts +++ b/app/services/newsletter-service.server.ts @@ -200,15 +200,14 @@ export async function confirmNewsletterSubscription( const tokenHash = hashActionToken(rawToken) const token = await drizzleClient.query.actionToken.findFirst({ - where: (t) => - and(eq(t.purpose, 'newsletter_confirmation'), eq(t.tokenHash, tokenHash)), + where: { purpose: 'newsletter_confirmation', tokenHash }, }) if (!token) return 'forbidden' if (now.getTime() > token.expiresAt.getTime()) return 'expired' const currentUser = await drizzleClient.query.user.findFirst({ - where: (u) => eq(u.id, token.userId), + where: { id: token.userId }, }) if (!currentUser) return 'forbidden' diff --git a/app/services/user-service.server.ts b/app/services/user-service.server.ts index 7f7a8435d..1139e1a93 100644 --- a/app/services/user-service.server.ts +++ b/app/services/user-service.server.ts @@ -457,8 +457,7 @@ export const confirmEmail = async ( const tokenHash = hashActionToken(rawToken) const token = await drizzleClient.query.actionToken.findFirst({ - where: (t, { and, eq }) => - and(eq(t.purpose, 'email_confirmation'), eq(t.tokenHash, tokenHash)), + where: { purpose: 'email_confirmation', tokenHash }, }) if (!token) return 'forbidden' @@ -466,7 +465,7 @@ export const confirmEmail = async ( const result = await drizzleClient.transaction(async (tx) => { const currentUser = await tx.query.user.findFirst({ - where: (u, { eq }) => eq(u.id, token.userId), + where: { id: token.userId }, }) if (!currentUser) return 'forbidden' as const @@ -479,12 +478,11 @@ export const confirmEmail = async ( const emailChanged = previousEmail.toLowerCase() !== confirmedEmail // Capture this before replacing it later, so an old newsletter link cannot confirm a new account email. const pendingNewsletterConfirmation = await tx.query.actionToken.findFirst({ - where: (t, { and, eq, gt }) => - and( - eq(t.userId, currentUser.id), - eq(t.purpose, 'newsletter_confirmation'), - gt(t.expiresAt, now), - ), + where: { + userId: currentUser.id, + purpose: 'newsletter_confirmation', + expiresAt: { gt: now }, + }, }) if (pendingEmail) { @@ -572,7 +570,7 @@ export const confirmEmail = async ( */ export const requestPasswordReset = async (email: string) => { const user = await drizzleClient.query.user.findFirst({ - where: (user, { eq }) => eq(user.email, email.toLowerCase()), + where: { email: email.toLowerCase() }, }) if (!user) return @@ -620,8 +618,7 @@ export const resetPassword = async ( const tokenHash = hashActionToken(passwordResetToken) const token = await drizzleClient.query.actionToken.findFirst({ - where: (t, { and, eq }) => - and(eq(t.purpose, 'password_reset'), eq(t.tokenHash, tokenHash)), + where: { purpose: 'password_reset', tokenHash }, }) if (!token) return 'forbidden' @@ -693,8 +690,9 @@ export const signIn = async ( password: string, ): Promise<{ user: User; jwt: string; refreshToken: string } | null> => { const user = await drizzleClient.query.user.findFirst({ - where: (user, { eq, or }) => - or(eq(user.email, emailOrName.toLowerCase()), eq(user.name, emailOrName)), + where: { + OR: [{ email: emailOrName.toLowerCase() }, { name: emailOrName }], + }, with: { password: true, devices: { columns: { id: true } }, From 7e678e1f3fd5f45dd5fdb7f38b7a51f1daccb266 Mon Sep 17 00:00:00 2001 From: jona159 Date: Wed, 22 Jul 2026 08:38:51 +0200 Subject: [PATCH 4/6] feat: initialize with teh v1 config-object API --- scripts/db/migrate.ts | 2 +- scripts/db/seed-integrations.ts | 2 +- scripts/db/seed-orphan-user.ts | 2 +- scripts/db/seed-tos.ts | 2 +- scripts/db/seed.ts | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/db/migrate.ts b/scripts/db/migrate.ts index f6fee402d..9c1c9b2d7 100644 --- a/scripts/db/migrate.ts +++ b/scripts/db/migrate.ts @@ -11,7 +11,7 @@ const migrationConnection = postgres(envDBSchema.DATABASE_URL, { async function main() { console.log('Migrations started...') - await migrate(drizzle(migrationConnection), { + await migrate(drizzle({ client: migrationConnection }), { migrationsFolder: './app/db/drizzle', }) await migrationConnection.end() diff --git a/scripts/db/seed-integrations.ts b/scripts/db/seed-integrations.ts index 41ccbc216..8fe1bbc95 100644 --- a/scripts/db/seed-integrations.ts +++ b/scripts/db/seed-integrations.ts @@ -9,7 +9,7 @@ const queryClient = postgres(envDBSchema.DATABASE_URL, { max: 1, ssl: envDBSchema.PG_CLIENT_SSL === 'true' ? true : false, }) -const client = drizzle(queryClient) +const client = drizzle({ client: queryClient }) async function seed() { await client diff --git a/scripts/db/seed-orphan-user.ts b/scripts/db/seed-orphan-user.ts index ece73dd4e..4163ce89f 100644 --- a/scripts/db/seed-orphan-user.ts +++ b/scripts/db/seed-orphan-user.ts @@ -12,7 +12,7 @@ const queryClient = postgres(envDBSchema.DATABASE_URL, { ssl: envDBSchema.PG_CLIENT_SSL === 'true' ? true : false, }) -const client = drizzle(queryClient) +const client = drizzle({ client: queryClient }) async function seed() { await client diff --git a/scripts/db/seed-tos.ts b/scripts/db/seed-tos.ts index ea49e9c06..d370c683f 100644 --- a/scripts/db/seed-tos.ts +++ b/scripts/db/seed-tos.ts @@ -303,7 +303,7 @@ async function main() { ssl: envDBSchema.PG_CLIENT_SSL === 'true' ? true : false, }) - const db = drizzle(queryClient) + const db = drizzle({ client: queryClient }) try { await seedTos(db) diff --git a/scripts/db/seed.ts b/scripts/db/seed.ts index 7afb23ffc..73922cb3b 100644 --- a/scripts/db/seed.ts +++ b/scripts/db/seed.ts @@ -19,7 +19,7 @@ const queryClient = postgres(envDBSchema.DATABASE_URL, { max: 1, ssl: envDBSchema.PG_CLIENT_SSL === 'true' ? true : false, }) -const client = drizzle(queryClient) +const client = drizzle({ client: queryClient }) function printProgress(text: string) { if (process.stdout.cursorTo) { From 9ef13f8eeee4d38b44ce022eb745950076cbf5d2 Mon Sep 17 00:00:00 2001 From: jona159 Date: Wed, 22 Jul 2026 08:39:12 +0200 Subject: [PATCH 5/6] fix: replace callbacks in test --- tests/routes/api.location.spec.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/routes/api.location.spec.ts b/tests/routes/api.location.spec.ts index 8e4eda4a0..cc7dfc260 100644 --- a/tests/routes/api.location.spec.ts +++ b/tests/routes/api.location.spec.ts @@ -44,19 +44,19 @@ describe('openSenseMap API Routes: Location Measurements', () => { // Helper function to get device's current location async function getDeviceCurrentLocation(deviceId: string) { const deviceWithLocations = await drizzleClient.query.device.findFirst({ - where: (device, { eq }) => eq(device.id, deviceId), + where: { id: deviceId }, with: { locations: { - orderBy: (deviceToLocation, { desc }) => [ - desc(deviceToLocation.time), - ], + orderBy: { time: 'desc' }, limit: 1, with: { geometry: { columns: {}, extras: { - x: sql`ST_X(${location.location})`.as('x'), - y: sql`ST_Y(${location.location})`.as('y'), + x: (location) => + sql`ST_X(${location.location})`.as('x'), + y: (location) => + sql`ST_Y(${location.location})`.as('y'), }, }, }, From a428f50f76cd3b1322e2393ea835bfbdf9493e7a Mon Sep 17 00:00:00 2001 From: jona159 Date: Wed, 22 Jul 2026 08:41:24 +0200 Subject: [PATCH 6/6] feat: migrate migration folder structure --- .../migration.sql} | 0 .../snapshot.json | 880 ++++++ .../migration.sql} | 0 .../snapshot.json | 880 ++++++ .../migration.sql} | 0 .../snapshot.json | 880 ++++++ .../migration.sql} | 0 .../snapshot.json | 880 ++++++ .../migration.sql} | 0 .../snapshot.json | 880 ++++++ .../migration.sql} | 0 .../snapshot.json | 880 ++++++ .../migration.sql} | 0 .../snapshot.json | 906 +++++++ .../migration.sql} | 0 .../snapshot.json | 987 +++++++ .../migration.sql} | 0 .../snapshot.json | 1000 +++++++ .../migration.sql} | 0 .../20241029085242_add_postgis/snapshot.json | 1000 +++++++ .../migration.sql} | 0 .../snapshot.json | 1208 +++++++++ .../migration.sql} | 0 .../snapshot.json | 1208 +++++++++ .../migration.sql} | 0 .../snapshot.json | 1213 +++++++++ .../migration.sql} | 0 .../snapshot.json | 1243 +++++++++ .../migration.sql} | 0 .../snapshot.json | 1243 +++++++++ .../migration.sql} | 0 .../snapshot.json | 1243 +++++++++ .../migration.sql} | 0 .../snapshot.json | 1305 +++++++++ .../migration.sql} | 0 .../snapshot.json | 1350 ++++++++++ .../migration.sql} | 0 .../snapshot.json | 1350 ++++++++++ .../migration.sql} | 0 .../snapshot.json | 1387 ++++++++++ .../migration.sql} | 0 .../snapshot.json | 1460 ++++++++++ .../migration.sql} | 0 .../snapshot.json | 1509 +++++++++++ .../migration.sql} | 0 .../snapshot.json | 1652 ++++++++++++ .../migration.sql} | 0 .../snapshot.json | 1652 ++++++++++++ .../migration.sql} | 0 .../snapshot.json | 1675 ++++++++++++ .../migration.sql} | 0 .../snapshot.json | 1675 ++++++++++++ .../migration.sql} | 0 .../20260121101628_misty_switch/snapshot.json | 1688 ++++++++++++ .../migration.sql} | 0 .../snapshot.json | 1688 ++++++++++++ .../migration.sql} | 0 .../snapshot.json | 1688 ++++++++++++ .../migration.sql} | 0 .../snapshot.json | 1688 ++++++++++++ .../migration.sql} | 0 .../snapshot.json | 1652 ++++++++++++ .../migration.sql} | 0 .../snapshot.json | 1796 +++++++++++++ .../migration.sql} | 0 .../snapshot.json | 1796 +++++++++++++ .../migration.sql} | 0 .../snapshot.json | 1796 +++++++++++++ .../migration.sql} | 0 .../snapshot.json | 1809 +++++++++++++ .../migration.sql} | 0 .../20260317103034_known_wiccan/snapshot.json | 1820 +++++++++++++ .../migration.sql} | 0 .../snapshot.json | 1833 +++++++++++++ .../migration.sql} | 0 .../snapshot.json | 2272 ++++++++++++++++ .../migration.sql} | 0 .../snapshot.json | 2259 ++++++++++++++++ .../migration.sql} | 0 .../snapshot.json | 2259 ++++++++++++++++ .../migration.sql} | 0 .../snapshot.json | 2272 ++++++++++++++++ .../migration.sql} | 0 .../snapshot.json | 2272 ++++++++++++++++ .../migration.sql} | 0 .../snapshot.json | 2272 ++++++++++++++++ .../migration.sql} | 0 .../snapshot.json | 2295 ++++++++++++++++ .../migration.sql} | 0 .../snapshot.json | 2334 ++++++++++++++++ .../migration.sql} | 0 .../snapshot.json | 2347 +++++++++++++++++ app/db/drizzle/meta/0000_snapshot.json | 501 ---- app/db/drizzle/meta/0001_snapshot.json | 501 ---- app/db/drizzle/meta/0002_snapshot.json | 501 ---- app/db/drizzle/meta/0003_snapshot.json | 501 ---- app/db/drizzle/meta/0004_snapshot.json | 501 ---- app/db/drizzle/meta/0005_snapshot.json | 501 ---- app/db/drizzle/meta/0006_snapshot.json | 518 ---- app/db/drizzle/meta/0007_snapshot.json | 560 ---- app/db/drizzle/meta/0008_snapshot.json | 567 ---- app/db/drizzle/meta/0009_snapshot.json | 567 ---- app/db/drizzle/meta/0010_snapshot.json | 708 ----- app/db/drizzle/meta/0011_snapshot.json | 962 ------- app/db/drizzle/meta/0012_snapshot.json | 967 ------- app/db/drizzle/meta/0013_snapshot.json | 987 ------- app/db/drizzle/meta/0014_snapshot.json | 987 ------- app/db/drizzle/meta/0015_snapshot.json | 987 ------- app/db/drizzle/meta/0016_snapshot.json | 1032 -------- app/db/drizzle/meta/0017_snapshot.json | 1063 -------- app/db/drizzle/meta/0018_snapshot.json | 1063 -------- app/db/drizzle/meta/0019_snapshot.json | 1082 -------- app/db/drizzle/meta/0020_snapshot.json | 1135 -------- app/db/drizzle/meta/0021_snapshot.json | 1174 --------- app/db/drizzle/meta/0022_snapshot.json | 1187 --------- app/db/drizzle/meta/0023_snapshot.json | 1187 --------- app/db/drizzle/meta/0024_snapshot.json | 1279 --------- app/db/drizzle/meta/0025_snapshot.json | 1279 --------- app/db/drizzle/meta/0026_snapshot.json | 1285 --------- app/db/drizzle/meta/0027_snapshot.json | 1285 --------- app/db/drizzle/meta/0028_snapshot.json | 1286 --------- app/db/drizzle/meta/0029_snapshot.json | 1286 --------- app/db/drizzle/meta/0030_snapshot.json | 1253 --------- app/db/drizzle/meta/0031_snapshot.json | 1330 ---------- app/db/drizzle/meta/0032_snapshot.json | 1330 ---------- app/db/drizzle/meta/0033_snapshot.json | 1330 ---------- app/db/drizzle/meta/0034_snapshot.json | 1336 ---------- app/db/drizzle/meta/0035_snapshot.json | 1343 ---------- app/db/drizzle/meta/0036_snapshot.json | 1350 ---------- app/db/drizzle/meta/0037_snapshot.json | 1623 ------------ app/db/drizzle/meta/0038_snapshot.json | 1617 ------------ app/db/drizzle/meta/0039_snapshot.json | 1617 ------------ app/db/drizzle/meta/0040_snapshot.json | 1623 ------------ app/db/drizzle/meta/0041_snapshot.json | 1623 ------------ app/db/drizzle/meta/0042_snapshot.json | 1623 ------------ app/db/drizzle/meta/0043_snapshot.json | 1640 ------------ app/db/drizzle/meta/0044_snapshot.json | 1659 ------------ app/db/drizzle/meta/0045_snapshot.json | 1666 ------------ app/db/drizzle/meta/_journal.json | 328 --- 139 files changed, 71382 insertions(+), 51730 deletions(-) rename app/db/drizzle/{0000_whole_jamie_braddock.sql => 20240612085211_whole_jamie_braddock/migration.sql} (100%) create mode 100644 app/db/drizzle/20240612085211_whole_jamie_braddock/snapshot.json rename app/db/drizzle/{0001_watery_wolverine.sql => 20240612085218_watery_wolverine/migration.sql} (100%) create mode 100644 app/db/drizzle/20240612085218_watery_wolverine/snapshot.json rename app/db/drizzle/{0002_exotic_morbius.sql => 20240612085247_exotic_morbius/migration.sql} (100%) create mode 100644 app/db/drizzle/20240612085247_exotic_morbius/snapshot.json rename app/db/drizzle/{0003_plain_la_nuit.sql => 20240701095121_plain_la_nuit/migration.sql} (100%) create mode 100644 app/db/drizzle/20240701095121_plain_la_nuit/snapshot.json rename app/db/drizzle/{0004_warm_triathlon.sql => 20240701111758_warm_triathlon/migration.sql} (100%) create mode 100644 app/db/drizzle/20240701111758_warm_triathlon/snapshot.json rename app/db/drizzle/{0005_lying_riptide.sql => 20240712090358_lying_riptide/migration.sql} (100%) create mode 100644 app/db/drizzle/20240712090358_lying_riptide/snapshot.json rename app/db/drizzle/{0006_wealthy_fat_cobra.sql => 20240729175152_wealthy_fat_cobra/migration.sql} (100%) create mode 100644 app/db/drizzle/20240729175152_wealthy_fat_cobra/snapshot.json rename app/db/drizzle/{0007_add_entryLogs.sql => 20241015083112_add_entryLogs/migration.sql} (100%) create mode 100644 app/db/drizzle/20241015083112_add_entryLogs/snapshot.json rename app/db/drizzle/{0008_add_deviceTags.sql => 20241016075632_add_deviceTags/migration.sql} (100%) create mode 100644 app/db/drizzle/20241016075632_add_deviceTags/snapshot.json rename app/db/drizzle/{0009_add_postgis.sql => 20241029085242_add_postgis/migration.sql} (100%) create mode 100644 app/db/drizzle/20241029085242_add_postgis/snapshot.json rename app/db/drizzle/{0010_add_locations.sql => 20241029085350_add_locations/migration.sql} (100%) create mode 100644 app/db/drizzle/20241029085350_add_locations/snapshot.json rename app/db/drizzle/{0011_delete_device_location.sql => 20241128112741_delete_device_location/migration.sql} (100%) create mode 100644 app/db/drizzle/20241128112741_delete_device_location/snapshot.json rename app/db/drizzle/{0012_define_device_models.sql => 20241210082326_define_device_models/migration.sql} (100%) create mode 100644 app/db/drizzle/20241210082326_define_device_models/snapshot.json rename app/db/drizzle/{0013_add_tempoary_devices.sql => 20241213121823_add_tempoary_devices/migration.sql} (100%) create mode 100644 app/db/drizzle/20241213121823_add_tempoary_devices/snapshot.json rename app/db/drizzle/{0014_cron_delete_temporary_devices.sql => 20241213124901_cron_delete_temporary_devices/migration.sql} (100%) create mode 100644 app/db/drizzle/20241213124901_cron_delete_temporary_devices/snapshot.json rename app/db/drizzle/{0015_cynical_thanos.sql => 20250128113736_cynical_thanos/migration.sql} (100%) create mode 100644 app/db/drizzle/20250128113736_cynical_thanos/snapshot.json rename app/db/drizzle/{0016_watery_cassandra_nova.sql => 20250521145657_watery_cassandra_nova/migration.sql} (100%) create mode 100644 app/db/drizzle/20250521145657_watery_cassandra_nova/snapshot.json rename app/db/drizzle/{0017_slimy_the_executioner.sql => 20250523071428_slimy_the_executioner/migration.sql} (100%) create mode 100644 app/db/drizzle/20250523071428_slimy_the_executioner/snapshot.json rename app/db/drizzle/{0018_dazzling_tattoo.sql => 20250526095338_dazzling_tattoo/migration.sql} (100%) create mode 100644 app/db/drizzle/20250526095338_dazzling_tattoo/snapshot.json rename app/db/drizzle/{0019_uneven_silver_surfer.sql => 20250527124923_uneven_silver_surfer/migration.sql} (100%) create mode 100644 app/db/drizzle/20250527124923_uneven_silver_surfer/snapshot.json rename app/db/drizzle/{0020_cloudy_misty_knight.sql => 20250527132433_cloudy_misty_knight/migration.sql} (100%) create mode 100644 app/db/drizzle/20250527132433_cloudy_misty_knight/snapshot.json rename app/db/drizzle/{0021_tense_sir_ram.sql => 20251008130543_tense_sir_ram/migration.sql} (100%) create mode 100644 app/db/drizzle/20251008130543_tense_sir_ram/snapshot.json rename app/db/drizzle/{0022_odd_sugar_man.sql => 20251022083513_odd_sugar_man/migration.sql} (100%) create mode 100644 app/db/drizzle/20251022083513_odd_sugar_man/snapshot.json rename app/db/drizzle/{0023_check_location.sql => 20251210153234_check_location/migration.sql} (100%) create mode 100644 app/db/drizzle/20251210153234_check_location/snapshot.json rename app/db/drizzle/{0024_first_kitty_pryde.sql => 20260109152213_first_kitty_pryde/migration.sql} (100%) create mode 100644 app/db/drizzle/20260109152213_first_kitty_pryde/snapshot.json rename app/db/drizzle/{0025_check-location-update.sql => 20260116173755_check-location-update/migration.sql} (100%) create mode 100644 app/db/drizzle/20260116173755_check-location-update/snapshot.json rename app/db/drizzle/{0026_misty_switch.sql => 20260121101628_misty_switch/migration.sql} (100%) create mode 100644 app/db/drizzle/20260121101628_misty_switch/snapshot.json rename app/db/drizzle/{0027_ambiguous_mariko_yashida.sql => 20260127085523_ambiguous_mariko_yashida/migration.sql} (100%) create mode 100644 app/db/drizzle/20260127085523_ambiguous_mariko_yashida/snapshot.json rename app/db/drizzle/{0028_gigantic_deadpool.sql => 20260127090910_gigantic_deadpool/migration.sql} (100%) create mode 100644 app/db/drizzle/20260127090910_gigantic_deadpool/snapshot.json rename app/db/drizzle/{0029_plain_black_widow.sql => 20260205095242_plain_black_widow/migration.sql} (100%) create mode 100644 app/db/drizzle/20260205095242_plain_black_widow/snapshot.json rename app/db/drizzle/{0030_parallel_toxin.sql => 20260205150521_parallel_toxin/migration.sql} (100%) create mode 100644 app/db/drizzle/20260205150521_parallel_toxin/snapshot.json rename app/db/drizzle/{0031_silly_the_call.sql => 20260217112953_silly_the_call/migration.sql} (100%) create mode 100644 app/db/drizzle/20260217112953_silly_the_call/snapshot.json rename app/db/drizzle/{0032_equal_young_avengers.sql => 20260217124150_equal_young_avengers/migration.sql} (100%) create mode 100644 app/db/drizzle/20260217124150_equal_young_avengers/snapshot.json rename app/db/drizzle/{0033_caag-retention-policies.sql => 20260225085431_caag-retention-policies/migration.sql} (100%) create mode 100644 app/db/drizzle/20260225085431_caag-retention-policies/snapshot.json rename app/db/drizzle/{0034_moaning_ironclad.sql => 20260313133711_moaning_ironclad/migration.sql} (100%) create mode 100644 app/db/drizzle/20260313133711_moaning_ironclad/snapshot.json rename app/db/drizzle/{0035_known_wiccan.sql => 20260317103034_known_wiccan/migration.sql} (100%) create mode 100644 app/db/drizzle/20260317103034_known_wiccan/snapshot.json rename app/db/drizzle/{0036_even_power_man.sql => 20260318110532_even_power_man/migration.sql} (100%) create mode 100644 app/db/drizzle/20260318110532_even_power_man/snapshot.json rename app/db/drizzle/{0037_amused_bullseye.sql => 20260323112954_amused_bullseye/migration.sql} (100%) create mode 100644 app/db/drizzle/20260323112954_amused_bullseye/snapshot.json rename app/db/drizzle/{0038_peaceful_the_enforcers.sql => 20260325073938_peaceful_the_enforcers/migration.sql} (100%) create mode 100644 app/db/drizzle/20260325073938_peaceful_the_enforcers/snapshot.json rename app/db/drizzle/{0039_simple_wallow.sql => 20260325074736_simple_wallow/migration.sql} (100%) create mode 100644 app/db/drizzle/20260325074736_simple_wallow/snapshot.json rename app/db/drizzle/{0040_luxuriant_mathemanic.sql => 20260325095346_luxuriant_mathemanic/migration.sql} (100%) create mode 100644 app/db/drizzle/20260325095346_luxuriant_mathemanic/snapshot.json rename app/db/drizzle/{0041_cleanup_expired_tos_users.sql => 20260325101029_cleanup_expired_tos_users/migration.sql} (100%) create mode 100644 app/db/drizzle/20260325101029_cleanup_expired_tos_users/snapshot.json rename app/db/drizzle/{0042_medical_blackheart.sql => 20260512143407_medical_blackheart/migration.sql} (100%) create mode 100644 app/db/drizzle/20260512143407_medical_blackheart/snapshot.json rename app/db/drizzle/{0043_flowery_bedlam.sql => 20260610090146_flowery_bedlam/migration.sql} (100%) create mode 100644 app/db/drizzle/20260610090146_flowery_bedlam/snapshot.json rename app/db/drizzle/{0044_dusty_ultragirl.sql => 20260617144323_dusty_ultragirl/migration.sql} (100%) create mode 100644 app/db/drizzle/20260617144323_dusty_ultragirl/snapshot.json rename app/db/drizzle/{0045_blushing_chameleon.sql => 20260622094740_blushing_chameleon/migration.sql} (100%) create mode 100644 app/db/drizzle/20260622094740_blushing_chameleon/snapshot.json delete mode 100644 app/db/drizzle/meta/0000_snapshot.json delete mode 100644 app/db/drizzle/meta/0001_snapshot.json delete mode 100644 app/db/drizzle/meta/0002_snapshot.json delete mode 100644 app/db/drizzle/meta/0003_snapshot.json delete mode 100644 app/db/drizzle/meta/0004_snapshot.json delete mode 100644 app/db/drizzle/meta/0005_snapshot.json delete mode 100644 app/db/drizzle/meta/0006_snapshot.json delete mode 100644 app/db/drizzle/meta/0007_snapshot.json delete mode 100644 app/db/drizzle/meta/0008_snapshot.json delete mode 100644 app/db/drizzle/meta/0009_snapshot.json delete mode 100644 app/db/drizzle/meta/0010_snapshot.json delete mode 100644 app/db/drizzle/meta/0011_snapshot.json delete mode 100644 app/db/drizzle/meta/0012_snapshot.json delete mode 100644 app/db/drizzle/meta/0013_snapshot.json delete mode 100644 app/db/drizzle/meta/0014_snapshot.json delete mode 100644 app/db/drizzle/meta/0015_snapshot.json delete mode 100644 app/db/drizzle/meta/0016_snapshot.json delete mode 100644 app/db/drizzle/meta/0017_snapshot.json delete mode 100644 app/db/drizzle/meta/0018_snapshot.json delete mode 100644 app/db/drizzle/meta/0019_snapshot.json delete mode 100644 app/db/drizzle/meta/0020_snapshot.json delete mode 100644 app/db/drizzle/meta/0021_snapshot.json delete mode 100644 app/db/drizzle/meta/0022_snapshot.json delete mode 100644 app/db/drizzle/meta/0023_snapshot.json delete mode 100644 app/db/drizzle/meta/0024_snapshot.json delete mode 100644 app/db/drizzle/meta/0025_snapshot.json delete mode 100644 app/db/drizzle/meta/0026_snapshot.json delete mode 100644 app/db/drizzle/meta/0027_snapshot.json delete mode 100644 app/db/drizzle/meta/0028_snapshot.json delete mode 100644 app/db/drizzle/meta/0029_snapshot.json delete mode 100644 app/db/drizzle/meta/0030_snapshot.json delete mode 100644 app/db/drizzle/meta/0031_snapshot.json delete mode 100644 app/db/drizzle/meta/0032_snapshot.json delete mode 100644 app/db/drizzle/meta/0033_snapshot.json delete mode 100644 app/db/drizzle/meta/0034_snapshot.json delete mode 100644 app/db/drizzle/meta/0035_snapshot.json delete mode 100644 app/db/drizzle/meta/0036_snapshot.json delete mode 100644 app/db/drizzle/meta/0037_snapshot.json delete mode 100644 app/db/drizzle/meta/0038_snapshot.json delete mode 100644 app/db/drizzle/meta/0039_snapshot.json delete mode 100644 app/db/drizzle/meta/0040_snapshot.json delete mode 100644 app/db/drizzle/meta/0041_snapshot.json delete mode 100644 app/db/drizzle/meta/0042_snapshot.json delete mode 100644 app/db/drizzle/meta/0043_snapshot.json delete mode 100644 app/db/drizzle/meta/0044_snapshot.json delete mode 100644 app/db/drizzle/meta/0045_snapshot.json delete mode 100644 app/db/drizzle/meta/_journal.json diff --git a/app/db/drizzle/0000_whole_jamie_braddock.sql b/app/db/drizzle/20240612085211_whole_jamie_braddock/migration.sql similarity index 100% rename from app/db/drizzle/0000_whole_jamie_braddock.sql rename to app/db/drizzle/20240612085211_whole_jamie_braddock/migration.sql diff --git a/app/db/drizzle/20240612085211_whole_jamie_braddock/snapshot.json b/app/db/drizzle/20240612085211_whole_jamie_braddock/snapshot.json new file mode 100644 index 000000000..3216b74ed --- /dev/null +++ b/app/db/drizzle/20240612085211_whole_jamie_braddock/snapshot.json @@ -0,0 +1,880 @@ +{ + "id": "b24d2bce-0eeb-4d58-a082-5a6b1e4af4b2", + "prevIds": [ + "00000000-0000-0000-0000-000000000000" + ], + "version": "8", + "dialect": "postgres", + "ddl": [ + { + "isRlsEnabled": false, + "name": "device", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "device_pkey", + "schema": "public", + "table": "device", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "use_auth", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "exposure", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "exposure", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "model", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "latitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "longitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensorWikiModel", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "measurement", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "timestamp (3) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "sensor_id", + "time" + ], + "nullsNotDistinct": false, + "name": "measurement_sensor_id_time_unique", + "schema": "public", + "table": "measurement", + "entityType": "uniques" + }, + { + "isRlsEnabled": false, + "name": "password", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "password_user_id_user_id_fk", + "schema": "public", + "table": "password", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_pkey", + "schema": "public", + "table": "profile", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "username", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "username" + ], + "nullsNotDistinct": false, + "name": "profile_username_unique", + "schema": "public", + "table": "profile", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_user_id_user_id_fk", + "schema": "public", + "table": "profile", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile_image", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_image_pkey", + "schema": "public", + "table": "profile_image", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "alt_text", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content_type", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "blob", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "profile_id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "profile_id" + ], + "schemaTo": "public", + "tableTo": "profile", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_image_profile_id_profile_id_fk", + "schema": "public", + "table": "profile_image", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "sensor", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "sensor_pkey", + "schema": "public", + "table": "sensor", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensorWikiType", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensorWikiPhenomenon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensorWikiUnit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastMeasurement", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "data", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "user", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "user_pkey", + "schema": "public", + "table": "user", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'user'", + "generated": null, + "identity": null, + "name": "role", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'en_US'", + "generated": null, + "identity": null, + "name": "language", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "emailIsConfirmed", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "email" + ], + "nullsNotDistinct": false, + "name": "user_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "values": [ + "HOME_V2_LORA" + ], + "name": "model", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "indoor", + "outdoor", + "mobile", + "unknown" + ], + "name": "exposure", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "active", + "inactive", + "old" + ], + "name": "status", + "schema": "public", + "entityType": "enums" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/app/db/drizzle/0001_watery_wolverine.sql b/app/db/drizzle/20240612085218_watery_wolverine/migration.sql similarity index 100% rename from app/db/drizzle/0001_watery_wolverine.sql rename to app/db/drizzle/20240612085218_watery_wolverine/migration.sql diff --git a/app/db/drizzle/20240612085218_watery_wolverine/snapshot.json b/app/db/drizzle/20240612085218_watery_wolverine/snapshot.json new file mode 100644 index 000000000..48d9afa34 --- /dev/null +++ b/app/db/drizzle/20240612085218_watery_wolverine/snapshot.json @@ -0,0 +1,880 @@ +{ + "id": "67d8dfcf-df55-49e7-8ab7-eadb52bb1772", + "prevIds": [ + "b24d2bce-0eeb-4d58-a082-5a6b1e4af4b2" + ], + "version": "8", + "dialect": "postgres", + "ddl": [ + { + "isRlsEnabled": false, + "name": "device", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "device_pkey", + "schema": "public", + "table": "device", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "use_auth", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "exposure", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "exposure", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "model", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "latitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "longitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensorWikiModel", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "measurement", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "timestamp (3) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "sensor_id", + "time" + ], + "nullsNotDistinct": false, + "name": "measurement_sensor_id_time_unique", + "schema": "public", + "table": "measurement", + "entityType": "uniques" + }, + { + "isRlsEnabled": false, + "name": "password", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "password_user_id_user_id_fk", + "schema": "public", + "table": "password", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_pkey", + "schema": "public", + "table": "profile", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "username", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "username" + ], + "nullsNotDistinct": false, + "name": "profile_username_unique", + "schema": "public", + "table": "profile", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_user_id_user_id_fk", + "schema": "public", + "table": "profile", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile_image", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_image_pkey", + "schema": "public", + "table": "profile_image", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "alt_text", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content_type", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "blob", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "profile_id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "profile_id" + ], + "schemaTo": "public", + "tableTo": "profile", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_image_profile_id_profile_id_fk", + "schema": "public", + "table": "profile_image", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "sensor", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "sensor_pkey", + "schema": "public", + "table": "sensor", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensorWikiType", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensorWikiPhenomenon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensorWikiUnit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastMeasurement", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "data", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "user", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "user_pkey", + "schema": "public", + "table": "user", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'user'", + "generated": null, + "identity": null, + "name": "role", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'en_US'", + "generated": null, + "identity": null, + "name": "language", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "emailIsConfirmed", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "email" + ], + "nullsNotDistinct": false, + "name": "user_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "values": [ + "HOME_V2_LORA" + ], + "name": "model", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "indoor", + "outdoor", + "mobile", + "unknown" + ], + "name": "exposure", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "active", + "inactive", + "old" + ], + "name": "status", + "schema": "public", + "entityType": "enums" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/app/db/drizzle/0002_exotic_morbius.sql b/app/db/drizzle/20240612085247_exotic_morbius/migration.sql similarity index 100% rename from app/db/drizzle/0002_exotic_morbius.sql rename to app/db/drizzle/20240612085247_exotic_morbius/migration.sql diff --git a/app/db/drizzle/20240612085247_exotic_morbius/snapshot.json b/app/db/drizzle/20240612085247_exotic_morbius/snapshot.json new file mode 100644 index 000000000..c901d6741 --- /dev/null +++ b/app/db/drizzle/20240612085247_exotic_morbius/snapshot.json @@ -0,0 +1,880 @@ +{ + "id": "04d81e70-5422-45b0-9a9d-3a75736a2f43", + "prevIds": [ + "67d8dfcf-df55-49e7-8ab7-eadb52bb1772" + ], + "version": "8", + "dialect": "postgres", + "ddl": [ + { + "isRlsEnabled": false, + "name": "device", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "device_pkey", + "schema": "public", + "table": "device", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "use_auth", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "exposure", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "exposure", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "model", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "latitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "longitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensorWikiModel", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "measurement", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "timestamp (3) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "sensor_id", + "time" + ], + "nullsNotDistinct": false, + "name": "measurement_sensor_id_time_unique", + "schema": "public", + "table": "measurement", + "entityType": "uniques" + }, + { + "isRlsEnabled": false, + "name": "password", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "password_user_id_user_id_fk", + "schema": "public", + "table": "password", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_pkey", + "schema": "public", + "table": "profile", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "username", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "username" + ], + "nullsNotDistinct": false, + "name": "profile_username_unique", + "schema": "public", + "table": "profile", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_user_id_user_id_fk", + "schema": "public", + "table": "profile", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile_image", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_image_pkey", + "schema": "public", + "table": "profile_image", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "alt_text", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content_type", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "blob", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "profile_id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "profile_id" + ], + "schemaTo": "public", + "tableTo": "profile", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_image_profile_id_profile_id_fk", + "schema": "public", + "table": "profile_image", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "sensor", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "sensor_pkey", + "schema": "public", + "table": "sensor", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensorWikiType", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensorWikiPhenomenon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensorWikiUnit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastMeasurement", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "data", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "user", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "user_pkey", + "schema": "public", + "table": "user", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'user'", + "generated": null, + "identity": null, + "name": "role", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'en_US'", + "generated": null, + "identity": null, + "name": "language", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "emailIsConfirmed", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "email" + ], + "nullsNotDistinct": false, + "name": "user_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "values": [ + "HOME_V2_LORA" + ], + "name": "model", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "indoor", + "outdoor", + "mobile", + "unknown" + ], + "name": "exposure", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "active", + "inactive", + "old" + ], + "name": "status", + "schema": "public", + "entityType": "enums" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/app/db/drizzle/0003_plain_la_nuit.sql b/app/db/drizzle/20240701095121_plain_la_nuit/migration.sql similarity index 100% rename from app/db/drizzle/0003_plain_la_nuit.sql rename to app/db/drizzle/20240701095121_plain_la_nuit/migration.sql diff --git a/app/db/drizzle/20240701095121_plain_la_nuit/snapshot.json b/app/db/drizzle/20240701095121_plain_la_nuit/snapshot.json new file mode 100644 index 000000000..4e3fe3dc0 --- /dev/null +++ b/app/db/drizzle/20240701095121_plain_la_nuit/snapshot.json @@ -0,0 +1,880 @@ +{ + "id": "dca7d463-f950-4c72-bf96-1a6eaae5cf8b", + "prevIds": [ + "04d81e70-5422-45b0-9a9d-3a75736a2f43" + ], + "version": "8", + "dialect": "postgres", + "ddl": [ + { + "isRlsEnabled": false, + "name": "device", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "device_pkey", + "schema": "public", + "table": "device", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "use_auth", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "exposure", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "exposure", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "model", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "latitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "longitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensorWikiModel", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "measurement", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "timestamp (3) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "sensor_id", + "time" + ], + "nullsNotDistinct": false, + "name": "measurement_sensor_id_time_unique", + "schema": "public", + "table": "measurement", + "entityType": "uniques" + }, + { + "isRlsEnabled": false, + "name": "password", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "password_user_id_user_id_fk", + "schema": "public", + "table": "password", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_pkey", + "schema": "public", + "table": "profile", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "username", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "username" + ], + "nullsNotDistinct": false, + "name": "profile_username_unique", + "schema": "public", + "table": "profile", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_user_id_user_id_fk", + "schema": "public", + "table": "profile", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile_image", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_image_pkey", + "schema": "public", + "table": "profile_image", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "alt_text", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content_type", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "blob", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "profile_id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "profile_id" + ], + "schemaTo": "public", + "tableTo": "profile", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_image_profile_id_profile_id_fk", + "schema": "public", + "table": "profile_image", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "sensor", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "sensor_pkey", + "schema": "public", + "table": "sensor", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensorWikiType", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensorWikiPhenomenon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensorWikiUnit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastMeasurement", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "data", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "user", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "user_pkey", + "schema": "public", + "table": "user", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'user'", + "generated": null, + "identity": null, + "name": "role", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'en_US'", + "generated": null, + "identity": null, + "name": "language", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "emailIsConfirmed", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "email" + ], + "nullsNotDistinct": false, + "name": "user_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "values": [ + "HOME_V2_LORA" + ], + "name": "model", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "indoor", + "outdoor", + "mobile", + "unknown" + ], + "name": "exposure", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "active", + "inactive", + "old" + ], + "name": "status", + "schema": "public", + "entityType": "enums" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/app/db/drizzle/0004_warm_triathlon.sql b/app/db/drizzle/20240701111758_warm_triathlon/migration.sql similarity index 100% rename from app/db/drizzle/0004_warm_triathlon.sql rename to app/db/drizzle/20240701111758_warm_triathlon/migration.sql diff --git a/app/db/drizzle/20240701111758_warm_triathlon/snapshot.json b/app/db/drizzle/20240701111758_warm_triathlon/snapshot.json new file mode 100644 index 000000000..8fc594c58 --- /dev/null +++ b/app/db/drizzle/20240701111758_warm_triathlon/snapshot.json @@ -0,0 +1,880 @@ +{ + "id": "de8c44e3-3ed9-4ae4-b6d7-c21287899766", + "prevIds": [ + "dca7d463-f950-4c72-bf96-1a6eaae5cf8b" + ], + "version": "8", + "dialect": "postgres", + "ddl": [ + { + "isRlsEnabled": false, + "name": "device", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "device_pkey", + "schema": "public", + "table": "device", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "use_auth", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "exposure", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "exposure", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "model", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "latitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "longitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensorWikiModel", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "measurement", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "timestamp (3) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "sensor_id", + "time" + ], + "nullsNotDistinct": false, + "name": "measurement_sensor_id_time_unique", + "schema": "public", + "table": "measurement", + "entityType": "uniques" + }, + { + "isRlsEnabled": false, + "name": "password", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "password_user_id_user_id_fk", + "schema": "public", + "table": "password", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_pkey", + "schema": "public", + "table": "profile", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "username", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "username" + ], + "nullsNotDistinct": false, + "name": "profile_username_unique", + "schema": "public", + "table": "profile", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_user_id_user_id_fk", + "schema": "public", + "table": "profile", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile_image", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_image_pkey", + "schema": "public", + "table": "profile_image", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "alt_text", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content_type", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "blob", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "profile_id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "profile_id" + ], + "schemaTo": "public", + "tableTo": "profile", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_image_profile_id_profile_id_fk", + "schema": "public", + "table": "profile_image", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "sensor", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "sensor_pkey", + "schema": "public", + "table": "sensor", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensorWikiType", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensorWikiPhenomenon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensorWikiUnit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastMeasurement", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "data", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "user", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "user_pkey", + "schema": "public", + "table": "user", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'user'", + "generated": null, + "identity": null, + "name": "role", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'en_US'", + "generated": null, + "identity": null, + "name": "language", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "email_is_confirmed", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "email" + ], + "nullsNotDistinct": false, + "name": "user_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "values": [ + "HOME_V2_LORA" + ], + "name": "model", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "indoor", + "outdoor", + "mobile", + "unknown" + ], + "name": "exposure", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "active", + "inactive", + "old" + ], + "name": "status", + "schema": "public", + "entityType": "enums" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/app/db/drizzle/0005_lying_riptide.sql b/app/db/drizzle/20240712090358_lying_riptide/migration.sql similarity index 100% rename from app/db/drizzle/0005_lying_riptide.sql rename to app/db/drizzle/20240712090358_lying_riptide/migration.sql diff --git a/app/db/drizzle/20240712090358_lying_riptide/snapshot.json b/app/db/drizzle/20240712090358_lying_riptide/snapshot.json new file mode 100644 index 000000000..edd9626ed --- /dev/null +++ b/app/db/drizzle/20240712090358_lying_riptide/snapshot.json @@ -0,0 +1,880 @@ +{ + "id": "66ddf798-abd6-4995-a84f-3387f98c7f1b", + "prevIds": [ + "de8c44e3-3ed9-4ae4-b6d7-c21287899766" + ], + "version": "8", + "dialect": "postgres", + "ddl": [ + { + "isRlsEnabled": false, + "name": "device", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "device_pkey", + "schema": "public", + "table": "device", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "use_auth", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "exposure", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "exposure", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "model", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "latitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "longitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "measurement", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "timestamp (3) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "sensor_id", + "time" + ], + "nullsNotDistinct": false, + "name": "measurement_sensor_id_time_unique", + "schema": "public", + "table": "measurement", + "entityType": "uniques" + }, + { + "isRlsEnabled": false, + "name": "password", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "password_user_id_user_id_fk", + "schema": "public", + "table": "password", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_pkey", + "schema": "public", + "table": "profile", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "username", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "username" + ], + "nullsNotDistinct": false, + "name": "profile_username_unique", + "schema": "public", + "table": "profile", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_user_id_user_id_fk", + "schema": "public", + "table": "profile", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile_image", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_image_pkey", + "schema": "public", + "table": "profile_image", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "alt_text", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content_type", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "blob", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "profile_id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "profile_id" + ], + "schemaTo": "public", + "tableTo": "profile", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_image_profile_id_profile_id_fk", + "schema": "public", + "table": "profile_image", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "sensor", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "sensor_pkey", + "schema": "public", + "table": "sensor", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_phenomenon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastMeasurement", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "data", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "user", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "user_pkey", + "schema": "public", + "table": "user", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'user'", + "generated": null, + "identity": null, + "name": "role", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'en_US'", + "generated": null, + "identity": null, + "name": "language", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "email_is_confirmed", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "email" + ], + "nullsNotDistinct": false, + "name": "user_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "values": [ + "HOME_V2_LORA" + ], + "name": "model", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "indoor", + "outdoor", + "mobile", + "unknown" + ], + "name": "exposure", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "active", + "inactive", + "old" + ], + "name": "status", + "schema": "public", + "entityType": "enums" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/app/db/drizzle/0006_wealthy_fat_cobra.sql b/app/db/drizzle/20240729175152_wealthy_fat_cobra/migration.sql similarity index 100% rename from app/db/drizzle/0006_wealthy_fat_cobra.sql rename to app/db/drizzle/20240729175152_wealthy_fat_cobra/migration.sql diff --git a/app/db/drizzle/20240729175152_wealthy_fat_cobra/snapshot.json b/app/db/drizzle/20240729175152_wealthy_fat_cobra/snapshot.json new file mode 100644 index 000000000..e785eca58 --- /dev/null +++ b/app/db/drizzle/20240729175152_wealthy_fat_cobra/snapshot.json @@ -0,0 +1,906 @@ +{ + "id": "4f95bd7f-baee-4231-9a04-f2f7ed07ee59", + "prevIds": [ + "66ddf798-abd6-4995-a84f-3387f98c7f1b" + ], + "version": "8", + "dialect": "postgres", + "ddl": [ + { + "isRlsEnabled": false, + "name": "device", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "device_pkey", + "schema": "public", + "table": "device", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "image", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "link", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "use_auth", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "exposure", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "exposure", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "model", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "latitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "longitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "measurement", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "timestamp (3) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "sensor_id", + "time" + ], + "nullsNotDistinct": false, + "name": "measurement_sensor_id_time_unique", + "schema": "public", + "table": "measurement", + "entityType": "uniques" + }, + { + "isRlsEnabled": false, + "name": "password", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "password_user_id_user_id_fk", + "schema": "public", + "table": "password", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_pkey", + "schema": "public", + "table": "profile", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "username", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "username" + ], + "nullsNotDistinct": false, + "name": "profile_username_unique", + "schema": "public", + "table": "profile", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_user_id_user_id_fk", + "schema": "public", + "table": "profile", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile_image", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_image_pkey", + "schema": "public", + "table": "profile_image", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "alt_text", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content_type", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "blob", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "profile_id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "profile_id" + ], + "schemaTo": "public", + "tableTo": "profile", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_image_profile_id_profile_id_fk", + "schema": "public", + "table": "profile_image", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "sensor", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "sensor_pkey", + "schema": "public", + "table": "sensor", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_phenomenon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastMeasurement", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "data", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "user", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "user_pkey", + "schema": "public", + "table": "user", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'user'", + "generated": null, + "identity": null, + "name": "role", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'en_US'", + "generated": null, + "identity": null, + "name": "language", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "email_is_confirmed", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "email" + ], + "nullsNotDistinct": false, + "name": "user_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "values": [ + "HOME_V2_LORA" + ], + "name": "model", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "indoor", + "outdoor", + "mobile", + "unknown" + ], + "name": "exposure", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "active", + "inactive", + "old" + ], + "name": "status", + "schema": "public", + "entityType": "enums" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/app/db/drizzle/0007_add_entryLogs.sql b/app/db/drizzle/20241015083112_add_entryLogs/migration.sql similarity index 100% rename from app/db/drizzle/0007_add_entryLogs.sql rename to app/db/drizzle/20241015083112_add_entryLogs/migration.sql diff --git a/app/db/drizzle/20241015083112_add_entryLogs/snapshot.json b/app/db/drizzle/20241015083112_add_entryLogs/snapshot.json new file mode 100644 index 000000000..02e725458 --- /dev/null +++ b/app/db/drizzle/20241015083112_add_entryLogs/snapshot.json @@ -0,0 +1,987 @@ +{ + "id": "eabfb0f4-714a-41fc-ad8a-bfbd7149e2b0", + "prevIds": [ + "4f95bd7f-baee-4231-9a04-f2f7ed07ee59" + ], + "version": "8", + "dialect": "postgres", + "ddl": [ + { + "isRlsEnabled": false, + "name": "device", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "device_pkey", + "schema": "public", + "table": "device", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "image", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "link", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "use_auth", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "exposure", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "exposure", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "model", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "latitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "longitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "measurement", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "timestamp (3) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "sensor_id", + "time" + ], + "nullsNotDistinct": false, + "name": "measurement_sensor_id_time_unique", + "schema": "public", + "table": "measurement", + "entityType": "uniques" + }, + { + "isRlsEnabled": false, + "name": "password", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "password_user_id_user_id_fk", + "schema": "public", + "table": "password", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_pkey", + "schema": "public", + "table": "profile", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "username", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "username" + ], + "nullsNotDistinct": false, + "name": "profile_username_unique", + "schema": "public", + "table": "profile", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_user_id_user_id_fk", + "schema": "public", + "table": "profile", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile_image", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_image_pkey", + "schema": "public", + "table": "profile_image", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "alt_text", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content_type", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "blob", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "profile_id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "profile_id" + ], + "schemaTo": "public", + "tableTo": "profile", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_image_profile_id_profile_id_fk", + "schema": "public", + "table": "profile_image", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "sensor", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "sensor_pkey", + "schema": "public", + "table": "sensor", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_phenomenon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastMeasurement", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "data", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "user", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "user_pkey", + "schema": "public", + "table": "user", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'user'", + "generated": null, + "identity": null, + "name": "role", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'en_US'", + "generated": null, + "identity": null, + "name": "language", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "email_is_confirmed", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "email" + ], + "nullsNotDistinct": false, + "name": "user_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "isRlsEnabled": false, + "name": "log_entry", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "log_entry_pkey", + "schema": "public", + "table": "log_entry", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "values": [ + "indoor", + "outdoor", + "mobile", + "unknown" + ], + "name": "exposure", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "HOME_V2_LORA" + ], + "name": "model", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "active", + "inactive", + "old" + ], + "name": "status", + "schema": "public", + "entityType": "enums" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/app/db/drizzle/0008_add_deviceTags.sql b/app/db/drizzle/20241016075632_add_deviceTags/migration.sql similarity index 100% rename from app/db/drizzle/0008_add_deviceTags.sql rename to app/db/drizzle/20241016075632_add_deviceTags/migration.sql diff --git a/app/db/drizzle/20241016075632_add_deviceTags/snapshot.json b/app/db/drizzle/20241016075632_add_deviceTags/snapshot.json new file mode 100644 index 000000000..cfe52ffef --- /dev/null +++ b/app/db/drizzle/20241016075632_add_deviceTags/snapshot.json @@ -0,0 +1,1000 @@ +{ + "id": "109b9611-48ac-4cd7-8003-9bb880e663a5", + "prevIds": [ + "eabfb0f4-714a-41fc-ad8a-bfbd7149e2b0" + ], + "version": "8", + "dialect": "postgres", + "ddl": [ + { + "isRlsEnabled": false, + "name": "device", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "device_pkey", + "schema": "public", + "table": "device", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "image", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 1, + "default": "ARRAY[]", + "generated": null, + "identity": null, + "name": "tags", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "link", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "use_auth", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "exposure", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "exposure", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "model", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "latitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "longitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "measurement", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "timestamp (3) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "sensor_id", + "time" + ], + "nullsNotDistinct": false, + "name": "measurement_sensor_id_time_unique", + "schema": "public", + "table": "measurement", + "entityType": "uniques" + }, + { + "isRlsEnabled": false, + "name": "password", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "password_user_id_user_id_fk", + "schema": "public", + "table": "password", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_pkey", + "schema": "public", + "table": "profile", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "username", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "username" + ], + "nullsNotDistinct": false, + "name": "profile_username_unique", + "schema": "public", + "table": "profile", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_user_id_user_id_fk", + "schema": "public", + "table": "profile", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile_image", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_image_pkey", + "schema": "public", + "table": "profile_image", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "alt_text", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content_type", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "blob", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "profile_id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "profile_id" + ], + "schemaTo": "public", + "tableTo": "profile", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_image_profile_id_profile_id_fk", + "schema": "public", + "table": "profile_image", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "sensor", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "sensor_pkey", + "schema": "public", + "table": "sensor", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_phenomenon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastMeasurement", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "data", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "user", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "user_pkey", + "schema": "public", + "table": "user", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'user'", + "generated": null, + "identity": null, + "name": "role", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'en_US'", + "generated": null, + "identity": null, + "name": "language", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "email_is_confirmed", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "email" + ], + "nullsNotDistinct": false, + "name": "user_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "isRlsEnabled": false, + "name": "log_entry", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "log_entry_pkey", + "schema": "public", + "table": "log_entry", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "values": [ + "indoor", + "outdoor", + "mobile", + "unknown" + ], + "name": "exposure", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "HOME_V2_LORA" + ], + "name": "model", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "active", + "inactive", + "old" + ], + "name": "status", + "schema": "public", + "entityType": "enums" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/app/db/drizzle/0009_add_postgis.sql b/app/db/drizzle/20241029085242_add_postgis/migration.sql similarity index 100% rename from app/db/drizzle/0009_add_postgis.sql rename to app/db/drizzle/20241029085242_add_postgis/migration.sql diff --git a/app/db/drizzle/20241029085242_add_postgis/snapshot.json b/app/db/drizzle/20241029085242_add_postgis/snapshot.json new file mode 100644 index 000000000..138304d63 --- /dev/null +++ b/app/db/drizzle/20241029085242_add_postgis/snapshot.json @@ -0,0 +1,1000 @@ +{ + "id": "ac6a9359-cfa1-4edc-87ac-7a94ddde7b1c", + "prevIds": [ + "109b9611-48ac-4cd7-8003-9bb880e663a5" + ], + "version": "8", + "dialect": "postgres", + "ddl": [ + { + "isRlsEnabled": false, + "name": "device", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "device_pkey", + "schema": "public", + "table": "device", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "image", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 1, + "default": "ARRAY[]", + "generated": null, + "identity": null, + "name": "tags", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "link", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "use_auth", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "exposure", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "exposure", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "model", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "latitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "longitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "measurement", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "timestamp (3) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "sensor_id", + "time" + ], + "nullsNotDistinct": false, + "name": "measurement_sensor_id_time_unique", + "schema": "public", + "table": "measurement", + "entityType": "uniques" + }, + { + "isRlsEnabled": false, + "name": "password", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "password_user_id_user_id_fk", + "schema": "public", + "table": "password", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_pkey", + "schema": "public", + "table": "profile", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "username", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "username" + ], + "nullsNotDistinct": false, + "name": "profile_username_unique", + "schema": "public", + "table": "profile", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_user_id_user_id_fk", + "schema": "public", + "table": "profile", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile_image", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_image_pkey", + "schema": "public", + "table": "profile_image", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "alt_text", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content_type", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "blob", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "profile_id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "profile_id" + ], + "schemaTo": "public", + "tableTo": "profile", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_image_profile_id_profile_id_fk", + "schema": "public", + "table": "profile_image", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "sensor", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "sensor_pkey", + "schema": "public", + "table": "sensor", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_phenomenon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastMeasurement", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "data", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "user", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "user_pkey", + "schema": "public", + "table": "user", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'user'", + "generated": null, + "identity": null, + "name": "role", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'en_US'", + "generated": null, + "identity": null, + "name": "language", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "email_is_confirmed", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "email" + ], + "nullsNotDistinct": false, + "name": "user_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "isRlsEnabled": false, + "name": "log_entry", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "log_entry_pkey", + "schema": "public", + "table": "log_entry", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "values": [ + "indoor", + "outdoor", + "mobile", + "unknown" + ], + "name": "exposure", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "HOME_V2_LORA" + ], + "name": "model", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "active", + "inactive", + "old" + ], + "name": "status", + "schema": "public", + "entityType": "enums" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/app/db/drizzle/0010_add_locations.sql b/app/db/drizzle/20241029085350_add_locations/migration.sql similarity index 100% rename from app/db/drizzle/0010_add_locations.sql rename to app/db/drizzle/20241029085350_add_locations/migration.sql diff --git a/app/db/drizzle/20241029085350_add_locations/snapshot.json b/app/db/drizzle/20241029085350_add_locations/snapshot.json new file mode 100644 index 000000000..561263547 --- /dev/null +++ b/app/db/drizzle/20241029085350_add_locations/snapshot.json @@ -0,0 +1,1208 @@ +{ + "id": "7286a667-b707-4367-85d4-6406c69e402f", + "prevIds": [ + "ac6a9359-cfa1-4edc-87ac-7a94ddde7b1c" + ], + "version": "8", + "dialect": "postgres", + "ddl": [ + { + "isRlsEnabled": false, + "name": "device", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "device_pkey", + "schema": "public", + "table": "device", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "image", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 1, + "default": "ARRAY[]", + "generated": null, + "identity": null, + "name": "tags", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "link", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "use_auth", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "exposure", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "exposure", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "model", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "latitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "longitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "device_to_location", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "columns": [ + "device_id", + "location_id", + "time" + ], + "nameExplicit": false, + "name": "device_to_location_device_id_location_id_time_pk", + "schema": "public", + "table": "device_to_location", + "entityType": "pks" + }, + { + "nameExplicit": false, + "columns": [ + "device_id", + "location_id", + "time" + ], + "nullsNotDistinct": false, + "name": "device_to_location_device_id_location_id_time_unique", + "schema": "public", + "table": "device_to_location", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "device_to_location_device_id_device_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "device_to_location_location_id_location_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "measurement", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "timestamp (3) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "sensor_id", + "time" + ], + "nullsNotDistinct": false, + "name": "measurement_sensor_id_time_unique", + "schema": "public", + "table": "measurement", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "measurement_location_id_location_id_fk", + "schema": "public", + "table": "measurement", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "password", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "password_user_id_user_id_fk", + "schema": "public", + "table": "password", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_pkey", + "schema": "public", + "table": "profile", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "username", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "username" + ], + "nullsNotDistinct": false, + "name": "profile_username_unique", + "schema": "public", + "table": "profile", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_user_id_user_id_fk", + "schema": "public", + "table": "profile", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile_image", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_image_pkey", + "schema": "public", + "table": "profile_image", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "alt_text", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content_type", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "blob", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "profile_id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "profile_id" + ], + "schemaTo": "public", + "tableTo": "profile", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_image_profile_id_profile_id_fk", + "schema": "public", + "table": "profile_image", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "sensor", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "sensor_pkey", + "schema": "public", + "table": "sensor", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_phenomenon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastMeasurement", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "data", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "user", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "user_pkey", + "schema": "public", + "table": "user", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'user'", + "generated": null, + "identity": null, + "name": "role", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'en_US'", + "generated": null, + "identity": null, + "name": "language", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "email_is_confirmed", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "email" + ], + "nullsNotDistinct": false, + "name": "user_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "isRlsEnabled": false, + "name": "location", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "location_pkey", + "schema": "public", + "table": "location", + "entityType": "pks" + }, + { + "type": "serial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "type": "geometry(point)", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "location" + ], + "nullsNotDistinct": false, + "name": "location_location_unique", + "schema": "public", + "table": "location", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "location", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "gist", + "concurrently": false, + "name": "location_index", + "schema": "public", + "table": "location", + "entityType": "indexes" + }, + { + "isRlsEnabled": false, + "name": "log_entry", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "log_entry_pkey", + "schema": "public", + "table": "log_entry", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "values": [ + "indoor", + "outdoor", + "mobile", + "unknown" + ], + "name": "exposure", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "HOME_V2_LORA" + ], + "name": "model", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "active", + "inactive", + "old" + ], + "name": "status", + "schema": "public", + "entityType": "enums" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/app/db/drizzle/0011_delete_device_location.sql b/app/db/drizzle/20241128112741_delete_device_location/migration.sql similarity index 100% rename from app/db/drizzle/0011_delete_device_location.sql rename to app/db/drizzle/20241128112741_delete_device_location/migration.sql diff --git a/app/db/drizzle/20241128112741_delete_device_location/snapshot.json b/app/db/drizzle/20241128112741_delete_device_location/snapshot.json new file mode 100644 index 000000000..c0739c7ae --- /dev/null +++ b/app/db/drizzle/20241128112741_delete_device_location/snapshot.json @@ -0,0 +1,1208 @@ +{ + "id": "9547c380-88da-4d27-a2e5-9f07c0a554d0", + "prevIds": [ + "7286a667-b707-4367-85d4-6406c69e402f" + ], + "version": "8", + "dialect": "postgres", + "ddl": [ + { + "isRlsEnabled": false, + "name": "device", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "device_pkey", + "schema": "public", + "table": "device", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "image", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 1, + "default": "ARRAY[]", + "generated": null, + "identity": null, + "name": "tags", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "link", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "use_auth", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "exposure", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "exposure", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "model", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "latitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "longitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "device_to_location", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "columns": [ + "device_id", + "location_id", + "time" + ], + "nameExplicit": false, + "name": "device_to_location_device_id_location_id_time_pk", + "schema": "public", + "table": "device_to_location", + "entityType": "pks" + }, + { + "nameExplicit": false, + "columns": [ + "device_id", + "location_id", + "time" + ], + "nullsNotDistinct": false, + "name": "device_to_location_device_id_location_id_time_unique", + "schema": "public", + "table": "device_to_location", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "device_to_location_device_id_device_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "device_to_location_location_id_location_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "measurement", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "timestamp (3) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "sensor_id", + "time" + ], + "nullsNotDistinct": false, + "name": "measurement_sensor_id_time_unique", + "schema": "public", + "table": "measurement", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "measurement_location_id_location_id_fk", + "schema": "public", + "table": "measurement", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "password", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "password_user_id_user_id_fk", + "schema": "public", + "table": "password", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_pkey", + "schema": "public", + "table": "profile", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "username", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "username" + ], + "nullsNotDistinct": false, + "name": "profile_username_unique", + "schema": "public", + "table": "profile", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_user_id_user_id_fk", + "schema": "public", + "table": "profile", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile_image", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_image_pkey", + "schema": "public", + "table": "profile_image", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "alt_text", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content_type", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "blob", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "profile_id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "profile_id" + ], + "schemaTo": "public", + "tableTo": "profile", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_image_profile_id_profile_id_fk", + "schema": "public", + "table": "profile_image", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "sensor", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "sensor_pkey", + "schema": "public", + "table": "sensor", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_phenomenon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastMeasurement", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "data", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "user", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "user_pkey", + "schema": "public", + "table": "user", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'user'", + "generated": null, + "identity": null, + "name": "role", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'en_US'", + "generated": null, + "identity": null, + "name": "language", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "email_is_confirmed", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "email" + ], + "nullsNotDistinct": false, + "name": "user_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "isRlsEnabled": false, + "name": "location", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "location_pkey", + "schema": "public", + "table": "location", + "entityType": "pks" + }, + { + "type": "serial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "type": "geometry(point)", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "location" + ], + "nullsNotDistinct": false, + "name": "location_location_unique", + "schema": "public", + "table": "location", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "location", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "gist", + "concurrently": false, + "name": "location_index", + "schema": "public", + "table": "location", + "entityType": "indexes" + }, + { + "isRlsEnabled": false, + "name": "log_entry", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "log_entry_pkey", + "schema": "public", + "table": "log_entry", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "values": [ + "indoor", + "outdoor", + "mobile", + "unknown" + ], + "name": "exposure", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "HOME_V2_LORA" + ], + "name": "model", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "active", + "inactive", + "old" + ], + "name": "status", + "schema": "public", + "entityType": "enums" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/app/db/drizzle/0012_define_device_models.sql b/app/db/drizzle/20241210082326_define_device_models/migration.sql similarity index 100% rename from app/db/drizzle/0012_define_device_models.sql rename to app/db/drizzle/20241210082326_define_device_models/migration.sql diff --git a/app/db/drizzle/20241210082326_define_device_models/snapshot.json b/app/db/drizzle/20241210082326_define_device_models/snapshot.json new file mode 100644 index 000000000..701b0d54d --- /dev/null +++ b/app/db/drizzle/20241210082326_define_device_models/snapshot.json @@ -0,0 +1,1213 @@ +{ + "id": "da2da7ff-72a3-46ee-ac5f-92502a280488", + "prevIds": [ + "9547c380-88da-4d27-a2e5-9f07c0a554d0" + ], + "version": "8", + "dialect": "postgres", + "ddl": [ + { + "isRlsEnabled": false, + "name": "device", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "device_pkey", + "schema": "public", + "table": "device", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "image", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 1, + "default": "ARRAY[]", + "generated": null, + "identity": null, + "name": "tags", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "link", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "use_auth", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "exposure", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "exposure", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "model", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "latitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "longitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "device_to_location", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "columns": [ + "device_id", + "location_id", + "time" + ], + "nameExplicit": false, + "name": "device_to_location_device_id_location_id_time_pk", + "schema": "public", + "table": "device_to_location", + "entityType": "pks" + }, + { + "nameExplicit": false, + "columns": [ + "device_id", + "location_id", + "time" + ], + "nullsNotDistinct": false, + "name": "device_to_location_device_id_location_id_time_unique", + "schema": "public", + "table": "device_to_location", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "device_to_location_device_id_device_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "device_to_location_location_id_location_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "measurement", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "timestamp (3) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "sensor_id", + "time" + ], + "nullsNotDistinct": false, + "name": "measurement_sensor_id_time_unique", + "schema": "public", + "table": "measurement", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "measurement_location_id_location_id_fk", + "schema": "public", + "table": "measurement", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "password", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "password_user_id_user_id_fk", + "schema": "public", + "table": "password", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_pkey", + "schema": "public", + "table": "profile", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "username", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "username" + ], + "nullsNotDistinct": false, + "name": "profile_username_unique", + "schema": "public", + "table": "profile", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_user_id_user_id_fk", + "schema": "public", + "table": "profile", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile_image", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_image_pkey", + "schema": "public", + "table": "profile_image", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "alt_text", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content_type", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "blob", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "profile_id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "profile_id" + ], + "schemaTo": "public", + "tableTo": "profile", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_image_profile_id_profile_id_fk", + "schema": "public", + "table": "profile_image", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "sensor", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "sensor_pkey", + "schema": "public", + "table": "sensor", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_phenomenon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastMeasurement", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "data", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "user", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "user_pkey", + "schema": "public", + "table": "user", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'user'", + "generated": null, + "identity": null, + "name": "role", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'en_US'", + "generated": null, + "identity": null, + "name": "language", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "email_is_confirmed", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "email" + ], + "nullsNotDistinct": false, + "name": "user_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "isRlsEnabled": false, + "name": "location", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "location_pkey", + "schema": "public", + "table": "location", + "entityType": "pks" + }, + { + "type": "serial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "type": "geometry(point)", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "location" + ], + "nullsNotDistinct": false, + "name": "location_location_unique", + "schema": "public", + "table": "location", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "location", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "gist", + "concurrently": false, + "name": "location_index", + "schema": "public", + "table": "location", + "entityType": "indexes" + }, + { + "isRlsEnabled": false, + "name": "log_entry", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "log_entry_pkey", + "schema": "public", + "table": "log_entry", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "values": [ + "indoor", + "outdoor", + "mobile", + "unknown" + ], + "name": "exposure", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "homeV2Lora", + "homeV2Ethernet", + "homeV2Wifi", + "senseBox:Edu", + "luftdaten.info", + "Custom" + ], + "name": "model", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "active", + "inactive", + "old" + ], + "name": "status", + "schema": "public", + "entityType": "enums" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/app/db/drizzle/0013_add_tempoary_devices.sql b/app/db/drizzle/20241213121823_add_tempoary_devices/migration.sql similarity index 100% rename from app/db/drizzle/0013_add_tempoary_devices.sql rename to app/db/drizzle/20241213121823_add_tempoary_devices/migration.sql diff --git a/app/db/drizzle/20241213121823_add_tempoary_devices/snapshot.json b/app/db/drizzle/20241213121823_add_tempoary_devices/snapshot.json new file mode 100644 index 000000000..0f643ccf6 --- /dev/null +++ b/app/db/drizzle/20241213121823_add_tempoary_devices/snapshot.json @@ -0,0 +1,1243 @@ +{ + "id": "e97ae620-162c-4cdb-b520-602823aacfd7", + "prevIds": [ + "da2da7ff-72a3-46ee-ac5f-92502a280488" + ], + "version": "8", + "dialect": "postgres", + "ddl": [ + { + "isRlsEnabled": false, + "name": "device", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "device_pkey", + "schema": "public", + "table": "device", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "image", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 1, + "default": "ARRAY[]", + "generated": null, + "identity": null, + "name": "tags", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "link", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "use_auth", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "exposure", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "exposure", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "model", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "date", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "latitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "longitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "device_to_location", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "columns": [ + "device_id", + "location_id", + "time" + ], + "nameExplicit": false, + "name": "device_to_location_device_id_location_id_time_pk", + "schema": "public", + "table": "device_to_location", + "entityType": "pks" + }, + { + "nameExplicit": false, + "columns": [ + "device_id", + "location_id", + "time" + ], + "nullsNotDistinct": false, + "name": "device_to_location_device_id_location_id_time_unique", + "schema": "public", + "table": "device_to_location", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "device_to_location_device_id_device_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "device_to_location_location_id_location_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "measurement", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "timestamp (3) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "sensor_id", + "time" + ], + "nullsNotDistinct": false, + "name": "measurement_sensor_id_time_unique", + "schema": "public", + "table": "measurement", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "measurement_location_id_location_id_fk", + "schema": "public", + "table": "measurement", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "password", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "password_user_id_user_id_fk", + "schema": "public", + "table": "password", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_pkey", + "schema": "public", + "table": "profile", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "username", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "username" + ], + "nullsNotDistinct": false, + "name": "profile_username_unique", + "schema": "public", + "table": "profile", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_user_id_user_id_fk", + "schema": "public", + "table": "profile", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile_image", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_image_pkey", + "schema": "public", + "table": "profile_image", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "alt_text", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content_type", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "blob", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "profile_id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "profile_id" + ], + "schemaTo": "public", + "tableTo": "profile", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_image_profile_id_profile_id_fk", + "schema": "public", + "table": "profile_image", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "sensor", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "sensor_pkey", + "schema": "public", + "table": "sensor", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_phenomenon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastMeasurement", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "data", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "sensor_device_id_device_id_fk", + "schema": "public", + "table": "sensor", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "user", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "user_pkey", + "schema": "public", + "table": "user", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'user'", + "generated": null, + "identity": null, + "name": "role", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'en_US'", + "generated": null, + "identity": null, + "name": "language", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "email_is_confirmed", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "email" + ], + "nullsNotDistinct": false, + "name": "user_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "isRlsEnabled": false, + "name": "location", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "location_pkey", + "schema": "public", + "table": "location", + "entityType": "pks" + }, + { + "type": "serial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "type": "geometry(point)", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "location" + ], + "nullsNotDistinct": false, + "name": "location_location_unique", + "schema": "public", + "table": "location", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "location", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "gist", + "concurrently": false, + "name": "location_index", + "schema": "public", + "table": "location", + "entityType": "indexes" + }, + { + "isRlsEnabled": false, + "name": "log_entry", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "log_entry_pkey", + "schema": "public", + "table": "log_entry", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "values": [ + "indoor", + "outdoor", + "mobile", + "unknown" + ], + "name": "exposure", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "homeV2Lora", + "homeV2Ethernet", + "homeV2Wifi", + "senseBox:Edu", + "luftdaten.info", + "Custom" + ], + "name": "model", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "active", + "inactive", + "old" + ], + "name": "status", + "schema": "public", + "entityType": "enums" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/app/db/drizzle/0014_cron_delete_temporary_devices.sql b/app/db/drizzle/20241213124901_cron_delete_temporary_devices/migration.sql similarity index 100% rename from app/db/drizzle/0014_cron_delete_temporary_devices.sql rename to app/db/drizzle/20241213124901_cron_delete_temporary_devices/migration.sql diff --git a/app/db/drizzle/20241213124901_cron_delete_temporary_devices/snapshot.json b/app/db/drizzle/20241213124901_cron_delete_temporary_devices/snapshot.json new file mode 100644 index 000000000..44f2a6c79 --- /dev/null +++ b/app/db/drizzle/20241213124901_cron_delete_temporary_devices/snapshot.json @@ -0,0 +1,1243 @@ +{ + "id": "3d604837-c99d-4ac6-8e1f-2d8b18455b5d", + "prevIds": [ + "e97ae620-162c-4cdb-b520-602823aacfd7" + ], + "version": "8", + "dialect": "postgres", + "ddl": [ + { + "isRlsEnabled": false, + "name": "device", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "device_pkey", + "schema": "public", + "table": "device", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "image", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 1, + "default": "ARRAY[]", + "generated": null, + "identity": null, + "name": "tags", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "link", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "use_auth", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "exposure", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "exposure", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "model", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "date", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "latitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "longitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "device_to_location", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "columns": [ + "device_id", + "location_id", + "time" + ], + "nameExplicit": false, + "name": "device_to_location_device_id_location_id_time_pk", + "schema": "public", + "table": "device_to_location", + "entityType": "pks" + }, + { + "nameExplicit": false, + "columns": [ + "device_id", + "location_id", + "time" + ], + "nullsNotDistinct": false, + "name": "device_to_location_device_id_location_id_time_unique", + "schema": "public", + "table": "device_to_location", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "device_to_location_device_id_device_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "device_to_location_location_id_location_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "measurement", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "timestamp (3) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "sensor_id", + "time" + ], + "nullsNotDistinct": false, + "name": "measurement_sensor_id_time_unique", + "schema": "public", + "table": "measurement", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "measurement_location_id_location_id_fk", + "schema": "public", + "table": "measurement", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "password", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "password_user_id_user_id_fk", + "schema": "public", + "table": "password", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_pkey", + "schema": "public", + "table": "profile", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "username", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "username" + ], + "nullsNotDistinct": false, + "name": "profile_username_unique", + "schema": "public", + "table": "profile", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_user_id_user_id_fk", + "schema": "public", + "table": "profile", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile_image", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_image_pkey", + "schema": "public", + "table": "profile_image", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "alt_text", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content_type", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "blob", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "profile_id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "profile_id" + ], + "schemaTo": "public", + "tableTo": "profile", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_image_profile_id_profile_id_fk", + "schema": "public", + "table": "profile_image", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "sensor", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "sensor_pkey", + "schema": "public", + "table": "sensor", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_phenomenon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastMeasurement", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "data", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "sensor_device_id_device_id_fk", + "schema": "public", + "table": "sensor", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "user", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "user_pkey", + "schema": "public", + "table": "user", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'user'", + "generated": null, + "identity": null, + "name": "role", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'en_US'", + "generated": null, + "identity": null, + "name": "language", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "email_is_confirmed", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "email" + ], + "nullsNotDistinct": false, + "name": "user_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "isRlsEnabled": false, + "name": "location", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "location_pkey", + "schema": "public", + "table": "location", + "entityType": "pks" + }, + { + "type": "serial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "type": "geometry(point)", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "location" + ], + "nullsNotDistinct": false, + "name": "location_location_unique", + "schema": "public", + "table": "location", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "location", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "gist", + "concurrently": false, + "name": "location_index", + "schema": "public", + "table": "location", + "entityType": "indexes" + }, + { + "isRlsEnabled": false, + "name": "log_entry", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "log_entry_pkey", + "schema": "public", + "table": "log_entry", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "values": [ + "indoor", + "outdoor", + "mobile", + "unknown" + ], + "name": "exposure", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "homeV2Lora", + "homeV2Ethernet", + "homeV2Wifi", + "senseBox:Edu", + "luftdaten.info", + "Custom" + ], + "name": "model", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "active", + "inactive", + "old" + ], + "name": "status", + "schema": "public", + "entityType": "enums" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/app/db/drizzle/0015_cynical_thanos.sql b/app/db/drizzle/20250128113736_cynical_thanos/migration.sql similarity index 100% rename from app/db/drizzle/0015_cynical_thanos.sql rename to app/db/drizzle/20250128113736_cynical_thanos/migration.sql diff --git a/app/db/drizzle/20250128113736_cynical_thanos/snapshot.json b/app/db/drizzle/20250128113736_cynical_thanos/snapshot.json new file mode 100644 index 000000000..f5dbe4101 --- /dev/null +++ b/app/db/drizzle/20250128113736_cynical_thanos/snapshot.json @@ -0,0 +1,1243 @@ +{ + "id": "8aea00c4-c635-420b-86ea-cac6c2069424", + "prevIds": [ + "3d604837-c99d-4ac6-8e1f-2d8b18455b5d" + ], + "version": "8", + "dialect": "postgres", + "ddl": [ + { + "isRlsEnabled": false, + "name": "device", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "device_pkey", + "schema": "public", + "table": "device", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "image", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 1, + "default": "ARRAY[]", + "generated": null, + "identity": null, + "name": "tags", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "link", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "use_auth", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "exposure", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "exposure", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "model", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "date", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "latitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "longitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "device_to_location", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "columns": [ + "device_id", + "location_id", + "time" + ], + "nameExplicit": false, + "name": "device_to_location_device_id_location_id_time_pk", + "schema": "public", + "table": "device_to_location", + "entityType": "pks" + }, + { + "nameExplicit": false, + "columns": [ + "device_id", + "location_id", + "time" + ], + "nullsNotDistinct": false, + "name": "device_to_location_device_id_location_id_time_unique", + "schema": "public", + "table": "device_to_location", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "device_to_location_device_id_device_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "device_to_location_location_id_location_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "measurement", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "timestamp (3) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "sensor_id", + "time" + ], + "nullsNotDistinct": false, + "name": "measurement_sensor_id_time_unique", + "schema": "public", + "table": "measurement", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "measurement_location_id_location_id_fk", + "schema": "public", + "table": "measurement", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "password", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "password_user_id_user_id_fk", + "schema": "public", + "table": "password", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_pkey", + "schema": "public", + "table": "profile", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "username", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "username" + ], + "nullsNotDistinct": false, + "name": "profile_username_unique", + "schema": "public", + "table": "profile", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_user_id_user_id_fk", + "schema": "public", + "table": "profile", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile_image", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_image_pkey", + "schema": "public", + "table": "profile_image", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "alt_text", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content_type", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "blob", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "profile_id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "profile_id" + ], + "schemaTo": "public", + "tableTo": "profile", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_image_profile_id_profile_id_fk", + "schema": "public", + "table": "profile_image", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "sensor", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "sensor_pkey", + "schema": "public", + "table": "sensor", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_phenomenon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastMeasurement", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "data", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "sensor_device_id_device_id_fk", + "schema": "public", + "table": "sensor", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "user", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "user_pkey", + "schema": "public", + "table": "user", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'user'", + "generated": null, + "identity": null, + "name": "role", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'en_US'", + "generated": null, + "identity": null, + "name": "language", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "email_is_confirmed", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "email" + ], + "nullsNotDistinct": false, + "name": "user_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "isRlsEnabled": false, + "name": "location", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "location_pkey", + "schema": "public", + "table": "location", + "entityType": "pks" + }, + { + "type": "bigserial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "type": "geometry(point)", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "location" + ], + "nullsNotDistinct": false, + "name": "location_location_unique", + "schema": "public", + "table": "location", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "location", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "gist", + "concurrently": false, + "name": "location_index", + "schema": "public", + "table": "location", + "entityType": "indexes" + }, + { + "isRlsEnabled": false, + "name": "log_entry", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "log_entry_pkey", + "schema": "public", + "table": "log_entry", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "values": [ + "indoor", + "outdoor", + "mobile", + "unknown" + ], + "name": "exposure", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "homeV2Lora", + "homeV2Ethernet", + "homeV2Wifi", + "senseBox:Edu", + "luftdaten.info", + "Custom" + ], + "name": "model", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "active", + "inactive", + "old" + ], + "name": "status", + "schema": "public", + "entityType": "enums" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/app/db/drizzle/0016_watery_cassandra_nova.sql b/app/db/drizzle/20250521145657_watery_cassandra_nova/migration.sql similarity index 100% rename from app/db/drizzle/0016_watery_cassandra_nova.sql rename to app/db/drizzle/20250521145657_watery_cassandra_nova/migration.sql diff --git a/app/db/drizzle/20250521145657_watery_cassandra_nova/snapshot.json b/app/db/drizzle/20250521145657_watery_cassandra_nova/snapshot.json new file mode 100644 index 000000000..b50712489 --- /dev/null +++ b/app/db/drizzle/20250521145657_watery_cassandra_nova/snapshot.json @@ -0,0 +1,1305 @@ +{ + "id": "7b0ed096-a139-4a21-a6dc-cf2c06a63b80", + "prevIds": [ + "8aea00c4-c635-420b-86ea-cac6c2069424" + ], + "version": "8", + "dialect": "postgres", + "ddl": [ + { + "isRlsEnabled": false, + "name": "device", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "device_pkey", + "schema": "public", + "table": "device", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "image", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 1, + "default": "ARRAY[]", + "generated": null, + "identity": null, + "name": "tags", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "link", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "use_auth", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "exposure", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "exposure", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "model", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "date", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "latitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "longitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "device_to_location", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "columns": [ + "device_id", + "location_id", + "time" + ], + "nameExplicit": false, + "name": "device_to_location_device_id_location_id_time_pk", + "schema": "public", + "table": "device_to_location", + "entityType": "pks" + }, + { + "nameExplicit": false, + "columns": [ + "device_id", + "location_id", + "time" + ], + "nullsNotDistinct": false, + "name": "device_to_location_device_id_location_id_time_unique", + "schema": "public", + "table": "device_to_location", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "device_to_location_device_id_device_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "device_to_location_location_id_location_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "measurement", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "timestamp (3) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "sensor_id", + "time" + ], + "nullsNotDistinct": false, + "name": "measurement_sensor_id_time_unique", + "schema": "public", + "table": "measurement", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "measurement_location_id_location_id_fk", + "schema": "public", + "table": "measurement", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "password", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "password_user_id_user_id_fk", + "schema": "public", + "table": "password", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_pkey", + "schema": "public", + "table": "profile", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "username", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "username" + ], + "nullsNotDistinct": false, + "name": "profile_username_unique", + "schema": "public", + "table": "profile", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_user_id_user_id_fk", + "schema": "public", + "table": "profile", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile_image", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_image_pkey", + "schema": "public", + "table": "profile_image", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "alt_text", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content_type", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "blob", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "profile_id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "profile_id" + ], + "schemaTo": "public", + "tableTo": "profile", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_image_profile_id_profile_id_fk", + "schema": "public", + "table": "profile_image", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "sensor", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "sensor_pkey", + "schema": "public", + "table": "sensor", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_phenomenon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastMeasurement", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "data", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "sensor_device_id_device_id_fk", + "schema": "public", + "table": "sensor", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "user", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "user_pkey", + "schema": "public", + "table": "user", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'user'", + "generated": null, + "identity": null, + "name": "role", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'en_US'", + "generated": null, + "identity": null, + "name": "language", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "email_is_confirmed", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "email" + ], + "nullsNotDistinct": false, + "name": "user_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "isRlsEnabled": false, + "name": "location", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "location_pkey", + "schema": "public", + "table": "location", + "entityType": "pks" + }, + { + "type": "bigserial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "type": "geometry(point)", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "location" + ], + "nullsNotDistinct": false, + "name": "location_location_unique", + "schema": "public", + "table": "location", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "location", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "gist", + "concurrently": false, + "name": "location_index", + "schema": "public", + "table": "location", + "entityType": "indexes" + }, + { + "isRlsEnabled": false, + "name": "log_entry", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "log_entry_pkey", + "schema": "public", + "table": "log_entry", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "refresh_token", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "refresh_token_user_id_user_id_fk", + "schema": "public", + "table": "refresh_token", + "entityType": "fks" + }, + { + "values": [ + "indoor", + "outdoor", + "mobile", + "unknown" + ], + "name": "exposure", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "homeV2Lora", + "homeV2Ethernet", + "homeV2Wifi", + "senseBox:Edu", + "luftdaten.info", + "Custom" + ], + "name": "model", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "active", + "inactive", + "old" + ], + "name": "status", + "schema": "public", + "entityType": "enums" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/app/db/drizzle/0017_slimy_the_executioner.sql b/app/db/drizzle/20250523071428_slimy_the_executioner/migration.sql similarity index 100% rename from app/db/drizzle/0017_slimy_the_executioner.sql rename to app/db/drizzle/20250523071428_slimy_the_executioner/migration.sql diff --git a/app/db/drizzle/20250523071428_slimy_the_executioner/snapshot.json b/app/db/drizzle/20250523071428_slimy_the_executioner/snapshot.json new file mode 100644 index 000000000..ebc373477 --- /dev/null +++ b/app/db/drizzle/20250523071428_slimy_the_executioner/snapshot.json @@ -0,0 +1,1350 @@ +{ + "id": "76f42cd3-4ce5-4e6e-b3d6-5460a167ffbb", + "prevIds": [ + "7b0ed096-a139-4a21-a6dc-cf2c06a63b80" + ], + "version": "8", + "dialect": "postgres", + "ddl": [ + { + "isRlsEnabled": false, + "name": "device", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "device_pkey", + "schema": "public", + "table": "device", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "image", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 1, + "default": "ARRAY[]", + "generated": null, + "identity": null, + "name": "tags", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "link", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "use_auth", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "exposure", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "exposure", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "model", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "date", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "latitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "longitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "device_to_location", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "columns": [ + "device_id", + "location_id", + "time" + ], + "nameExplicit": false, + "name": "device_to_location_device_id_location_id_time_pk", + "schema": "public", + "table": "device_to_location", + "entityType": "pks" + }, + { + "nameExplicit": false, + "columns": [ + "device_id", + "location_id", + "time" + ], + "nullsNotDistinct": false, + "name": "device_to_location_device_id_location_id_time_unique", + "schema": "public", + "table": "device_to_location", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "device_to_location_device_id_device_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "device_to_location_location_id_location_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "measurement", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "timestamp (3) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "sensor_id", + "time" + ], + "nullsNotDistinct": false, + "name": "measurement_sensor_id_time_unique", + "schema": "public", + "table": "measurement", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "measurement_location_id_location_id_fk", + "schema": "public", + "table": "measurement", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "password", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "password_user_id_user_id_fk", + "schema": "public", + "table": "password", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_pkey", + "schema": "public", + "table": "profile", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "username", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "username" + ], + "nullsNotDistinct": false, + "name": "profile_username_unique", + "schema": "public", + "table": "profile", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_user_id_user_id_fk", + "schema": "public", + "table": "profile", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile_image", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_image_pkey", + "schema": "public", + "table": "profile_image", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "alt_text", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content_type", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "blob", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "profile_id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "profile_id" + ], + "schemaTo": "public", + "tableTo": "profile", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_image_profile_id_profile_id_fk", + "schema": "public", + "table": "profile_image", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "sensor", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "sensor_pkey", + "schema": "public", + "table": "sensor", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_phenomenon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastMeasurement", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "data", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "sensor_device_id_device_id_fk", + "schema": "public", + "table": "sensor", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "user", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "user_pkey", + "schema": "public", + "table": "user", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'user'", + "generated": null, + "identity": null, + "name": "role", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'en_US'", + "generated": null, + "identity": null, + "name": "language", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "email_is_confirmed", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "email" + ], + "nullsNotDistinct": false, + "name": "user_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "isRlsEnabled": false, + "name": "location", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "location_pkey", + "schema": "public", + "table": "location", + "entityType": "pks" + }, + { + "type": "bigserial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "type": "geometry(point)", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "location" + ], + "nullsNotDistinct": false, + "name": "location_location_unique", + "schema": "public", + "table": "location", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "location", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "gist", + "concurrently": false, + "name": "location_index", + "schema": "public", + "table": "location", + "entityType": "indexes" + }, + { + "isRlsEnabled": false, + "name": "log_entry", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "log_entry_pkey", + "schema": "public", + "table": "log_entry", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "refresh_token", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "refresh_token_user_id_user_id_fk", + "schema": "public", + "table": "refresh_token", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "token_revocation", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "values": [ + "indoor", + "outdoor", + "mobile", + "unknown" + ], + "name": "exposure", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "homeV2Lora", + "homeV2Ethernet", + "homeV2Wifi", + "senseBox:Edu", + "luftdaten.info", + "Custom" + ], + "name": "model", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "active", + "inactive", + "old" + ], + "name": "status", + "schema": "public", + "entityType": "enums" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/app/db/drizzle/0018_dazzling_tattoo.sql b/app/db/drizzle/20250526095338_dazzling_tattoo/migration.sql similarity index 100% rename from app/db/drizzle/0018_dazzling_tattoo.sql rename to app/db/drizzle/20250526095338_dazzling_tattoo/migration.sql diff --git a/app/db/drizzle/20250526095338_dazzling_tattoo/snapshot.json b/app/db/drizzle/20250526095338_dazzling_tattoo/snapshot.json new file mode 100644 index 000000000..690683b5f --- /dev/null +++ b/app/db/drizzle/20250526095338_dazzling_tattoo/snapshot.json @@ -0,0 +1,1350 @@ +{ + "id": "655c6d50-c7c2-4cee-99bd-7eb38e2257ad", + "prevIds": [ + "76f42cd3-4ce5-4e6e-b3d6-5460a167ffbb" + ], + "version": "8", + "dialect": "postgres", + "ddl": [ + { + "isRlsEnabled": false, + "name": "device", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "device_pkey", + "schema": "public", + "table": "device", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "image", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 1, + "default": "ARRAY[]", + "generated": null, + "identity": null, + "name": "tags", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "link", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "use_auth", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "exposure", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "exposure", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "model", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "date", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "latitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "longitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "device_to_location", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "columns": [ + "device_id", + "location_id", + "time" + ], + "nameExplicit": false, + "name": "device_to_location_device_id_location_id_time_pk", + "schema": "public", + "table": "device_to_location", + "entityType": "pks" + }, + { + "nameExplicit": false, + "columns": [ + "device_id", + "location_id", + "time" + ], + "nullsNotDistinct": false, + "name": "device_to_location_device_id_location_id_time_unique", + "schema": "public", + "table": "device_to_location", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "device_to_location_device_id_device_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "device_to_location_location_id_location_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "measurement", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "timestamp (3) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "sensor_id", + "time" + ], + "nullsNotDistinct": false, + "name": "measurement_sensor_id_time_unique", + "schema": "public", + "table": "measurement", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "measurement_location_id_location_id_fk", + "schema": "public", + "table": "measurement", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "password", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "password_user_id_user_id_fk", + "schema": "public", + "table": "password", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_pkey", + "schema": "public", + "table": "profile", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "username", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "username" + ], + "nullsNotDistinct": false, + "name": "profile_username_unique", + "schema": "public", + "table": "profile", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_user_id_user_id_fk", + "schema": "public", + "table": "profile", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile_image", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_image_pkey", + "schema": "public", + "table": "profile_image", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "alt_text", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content_type", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "blob", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "profile_id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "profile_id" + ], + "schemaTo": "public", + "tableTo": "profile", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_image_profile_id_profile_id_fk", + "schema": "public", + "table": "profile_image", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "sensor", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "sensor_pkey", + "schema": "public", + "table": "sensor", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_phenomenon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastMeasurement", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "data", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "sensor_device_id_device_id_fk", + "schema": "public", + "table": "sensor", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "user", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "user_pkey", + "schema": "public", + "table": "user", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'user'", + "generated": null, + "identity": null, + "name": "role", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'en_US'", + "generated": null, + "identity": null, + "name": "language", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "email_is_confirmed", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "email" + ], + "nullsNotDistinct": false, + "name": "user_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "isRlsEnabled": false, + "name": "location", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "location_pkey", + "schema": "public", + "table": "location", + "entityType": "pks" + }, + { + "type": "bigserial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "type": "geometry(point)", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "location" + ], + "nullsNotDistinct": false, + "name": "location_location_unique", + "schema": "public", + "table": "location", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "location", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "gist", + "concurrently": false, + "name": "location_index", + "schema": "public", + "table": "location", + "entityType": "indexes" + }, + { + "isRlsEnabled": false, + "name": "log_entry", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "log_entry_pkey", + "schema": "public", + "table": "log_entry", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "refresh_token", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "refresh_token_user_id_user_id_fk", + "schema": "public", + "table": "refresh_token", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "token_revocation", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "values": [ + "indoor", + "outdoor", + "mobile", + "unknown" + ], + "name": "exposure", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "homeV2Lora", + "homeV2Ethernet", + "homeV2Wifi", + "senseBox:Edu", + "luftdaten.info", + "Custom" + ], + "name": "model", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "active", + "inactive", + "old" + ], + "name": "status", + "schema": "public", + "entityType": "enums" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/app/db/drizzle/0019_uneven_silver_surfer.sql b/app/db/drizzle/20250527124923_uneven_silver_surfer/migration.sql similarity index 100% rename from app/db/drizzle/0019_uneven_silver_surfer.sql rename to app/db/drizzle/20250527124923_uneven_silver_surfer/migration.sql diff --git a/app/db/drizzle/20250527124923_uneven_silver_surfer/snapshot.json b/app/db/drizzle/20250527124923_uneven_silver_surfer/snapshot.json new file mode 100644 index 000000000..40c3ca7f2 --- /dev/null +++ b/app/db/drizzle/20250527124923_uneven_silver_surfer/snapshot.json @@ -0,0 +1,1387 @@ +{ + "id": "2083dc9a-c5d0-4805-b9c1-4331f4172065", + "prevIds": [ + "655c6d50-c7c2-4cee-99bd-7eb38e2257ad" + ], + "version": "8", + "dialect": "postgres", + "ddl": [ + { + "isRlsEnabled": false, + "name": "device", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "device_pkey", + "schema": "public", + "table": "device", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "image", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 1, + "default": "ARRAY[]", + "generated": null, + "identity": null, + "name": "tags", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "link", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "use_auth", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "exposure", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "exposure", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "model", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "date", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "latitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "longitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "device_to_location", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "columns": [ + "device_id", + "location_id", + "time" + ], + "nameExplicit": false, + "name": "device_to_location_device_id_location_id_time_pk", + "schema": "public", + "table": "device_to_location", + "entityType": "pks" + }, + { + "nameExplicit": false, + "columns": [ + "device_id", + "location_id", + "time" + ], + "nullsNotDistinct": false, + "name": "device_to_location_device_id_location_id_time_unique", + "schema": "public", + "table": "device_to_location", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "device_to_location_device_id_device_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "device_to_location_location_id_location_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "measurement", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "timestamp (3) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "sensor_id", + "time" + ], + "nullsNotDistinct": false, + "name": "measurement_sensor_id_time_unique", + "schema": "public", + "table": "measurement", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "measurement_location_id_location_id_fk", + "schema": "public", + "table": "measurement", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "password", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "password_user_id_user_id_fk", + "schema": "public", + "table": "password", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_pkey", + "schema": "public", + "table": "profile", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "username", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "username" + ], + "nullsNotDistinct": false, + "name": "profile_username_unique", + "schema": "public", + "table": "profile", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_user_id_user_id_fk", + "schema": "public", + "table": "profile", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile_image", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_image_pkey", + "schema": "public", + "table": "profile_image", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "alt_text", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content_type", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "blob", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "profile_id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "profile_id" + ], + "schemaTo": "public", + "tableTo": "profile", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_image_profile_id_profile_id_fk", + "schema": "public", + "table": "profile_image", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "sensor", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "sensor_pkey", + "schema": "public", + "table": "sensor", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_phenomenon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastMeasurement", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "data", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "sensor_device_id_device_id_fk", + "schema": "public", + "table": "sensor", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "user", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "user_pkey", + "schema": "public", + "table": "user", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unconfirmed_email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'user'", + "generated": null, + "identity": null, + "name": "role", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'en_US'", + "generated": null, + "identity": null, + "name": "language", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "email_is_confirmed", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email_confirmation_token", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "email" + ], + "nullsNotDistinct": false, + "name": "user_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "unconfirmed_email" + ], + "nullsNotDistinct": false, + "name": "user_unconfirmed_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "isRlsEnabled": false, + "name": "location", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "location_pkey", + "schema": "public", + "table": "location", + "entityType": "pks" + }, + { + "type": "bigserial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "type": "geometry(point)", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "location" + ], + "nullsNotDistinct": false, + "name": "location_location_unique", + "schema": "public", + "table": "location", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "location", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "gist", + "concurrently": false, + "name": "location_index", + "schema": "public", + "table": "location", + "entityType": "indexes" + }, + { + "isRlsEnabled": false, + "name": "log_entry", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "log_entry_pkey", + "schema": "public", + "table": "log_entry", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "refresh_token", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "refresh_token_user_id_user_id_fk", + "schema": "public", + "table": "refresh_token", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "token_revocation", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "values": [ + "indoor", + "outdoor", + "mobile", + "unknown" + ], + "name": "exposure", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "homeV2Lora", + "homeV2Ethernet", + "homeV2Wifi", + "senseBox:Edu", + "luftdaten.info", + "Custom" + ], + "name": "model", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "active", + "inactive", + "old" + ], + "name": "status", + "schema": "public", + "entityType": "enums" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/app/db/drizzle/0020_cloudy_misty_knight.sql b/app/db/drizzle/20250527132433_cloudy_misty_knight/migration.sql similarity index 100% rename from app/db/drizzle/0020_cloudy_misty_knight.sql rename to app/db/drizzle/20250527132433_cloudy_misty_knight/migration.sql diff --git a/app/db/drizzle/20250527132433_cloudy_misty_knight/snapshot.json b/app/db/drizzle/20250527132433_cloudy_misty_knight/snapshot.json new file mode 100644 index 000000000..b50922daa --- /dev/null +++ b/app/db/drizzle/20250527132433_cloudy_misty_knight/snapshot.json @@ -0,0 +1,1460 @@ +{ + "id": "9d89599f-78ef-4878-85a7-91a31bf984dc", + "prevIds": [ + "2083dc9a-c5d0-4805-b9c1-4331f4172065" + ], + "version": "8", + "dialect": "postgres", + "ddl": [ + { + "isRlsEnabled": false, + "name": "device", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "device_pkey", + "schema": "public", + "table": "device", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "image", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 1, + "default": "ARRAY[]", + "generated": null, + "identity": null, + "name": "tags", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "link", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "use_auth", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "exposure", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "exposure", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "model", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "date", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "latitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "longitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "device_to_location", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "columns": [ + "device_id", + "location_id", + "time" + ], + "nameExplicit": false, + "name": "device_to_location_device_id_location_id_time_pk", + "schema": "public", + "table": "device_to_location", + "entityType": "pks" + }, + { + "nameExplicit": false, + "columns": [ + "device_id", + "location_id", + "time" + ], + "nullsNotDistinct": false, + "name": "device_to_location_device_id_location_id_time_unique", + "schema": "public", + "table": "device_to_location", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "device_to_location_device_id_device_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "device_to_location_location_id_location_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "measurement", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "timestamp (3) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "sensor_id", + "time" + ], + "nullsNotDistinct": false, + "name": "measurement_sensor_id_time_unique", + "schema": "public", + "table": "measurement", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "measurement_location_id_location_id_fk", + "schema": "public", + "table": "measurement", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "password", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "password_user_id_user_id_fk", + "schema": "public", + "table": "password", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "password_reset_request", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "password_reset_request", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "password_reset_request", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "password_reset_request", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "nullsNotDistinct": false, + "name": "password_reset_request_user_id_unique", + "schema": "public", + "table": "password_reset_request", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "password_reset_request_user_id_user_id_fk", + "schema": "public", + "table": "password_reset_request", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_pkey", + "schema": "public", + "table": "profile", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "username", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "username" + ], + "nullsNotDistinct": false, + "name": "profile_username_unique", + "schema": "public", + "table": "profile", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_user_id_user_id_fk", + "schema": "public", + "table": "profile", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile_image", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_image_pkey", + "schema": "public", + "table": "profile_image", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "alt_text", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content_type", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "blob", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "profile_id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "profile_id" + ], + "schemaTo": "public", + "tableTo": "profile", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_image_profile_id_profile_id_fk", + "schema": "public", + "table": "profile_image", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "sensor", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "sensor_pkey", + "schema": "public", + "table": "sensor", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_phenomenon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastMeasurement", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "data", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "sensor_device_id_device_id_fk", + "schema": "public", + "table": "sensor", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "user", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "user_pkey", + "schema": "public", + "table": "user", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unconfirmed_email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'user'", + "generated": null, + "identity": null, + "name": "role", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'en_US'", + "generated": null, + "identity": null, + "name": "language", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "email_is_confirmed", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email_confirmation_token", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "email" + ], + "nullsNotDistinct": false, + "name": "user_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "unconfirmed_email" + ], + "nullsNotDistinct": false, + "name": "user_unconfirmed_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "isRlsEnabled": false, + "name": "location", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "location_pkey", + "schema": "public", + "table": "location", + "entityType": "pks" + }, + { + "type": "bigserial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "type": "geometry(point)", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "location" + ], + "nullsNotDistinct": false, + "name": "location_location_unique", + "schema": "public", + "table": "location", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "location", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "gist", + "concurrently": false, + "name": "location_index", + "schema": "public", + "table": "location", + "entityType": "indexes" + }, + { + "isRlsEnabled": false, + "name": "log_entry", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "log_entry_pkey", + "schema": "public", + "table": "log_entry", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "refresh_token", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "refresh_token_user_id_user_id_fk", + "schema": "public", + "table": "refresh_token", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "token_revocation", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "values": [ + "indoor", + "outdoor", + "mobile", + "unknown" + ], + "name": "exposure", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "homeV2Lora", + "homeV2Ethernet", + "homeV2Wifi", + "senseBox:Edu", + "luftdaten.info", + "Custom" + ], + "name": "model", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "active", + "inactive", + "old" + ], + "name": "status", + "schema": "public", + "entityType": "enums" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/app/db/drizzle/0021_tense_sir_ram.sql b/app/db/drizzle/20251008130543_tense_sir_ram/migration.sql similarity index 100% rename from app/db/drizzle/0021_tense_sir_ram.sql rename to app/db/drizzle/20251008130543_tense_sir_ram/migration.sql diff --git a/app/db/drizzle/20251008130543_tense_sir_ram/snapshot.json b/app/db/drizzle/20251008130543_tense_sir_ram/snapshot.json new file mode 100644 index 000000000..785df4226 --- /dev/null +++ b/app/db/drizzle/20251008130543_tense_sir_ram/snapshot.json @@ -0,0 +1,1509 @@ +{ + "id": "85481101-dd0d-4e15-9158-11971b8ba509", + "prevIds": [ + "9d89599f-78ef-4878-85a7-91a31bf984dc" + ], + "version": "8", + "dialect": "postgres", + "ddl": [ + { + "isRlsEnabled": false, + "name": "device", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "device_pkey", + "schema": "public", + "table": "device", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "image", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 1, + "default": "ARRAY[]", + "generated": null, + "identity": null, + "name": "tags", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "link", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "use_auth", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "exposure", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "exposure", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "model", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "date", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "latitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "longitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "device_to_location", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "columns": [ + "device_id", + "location_id", + "time" + ], + "nameExplicit": false, + "name": "device_to_location_device_id_location_id_time_pk", + "schema": "public", + "table": "device_to_location", + "entityType": "pks" + }, + { + "nameExplicit": false, + "columns": [ + "device_id", + "location_id", + "time" + ], + "nullsNotDistinct": false, + "name": "device_to_location_device_id_location_id_time_unique", + "schema": "public", + "table": "device_to_location", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "device_to_location_device_id_device_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "device_to_location_location_id_location_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "measurement", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "timestamp (3) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "sensor_id", + "time" + ], + "nullsNotDistinct": false, + "name": "measurement_sensor_id_time_unique", + "schema": "public", + "table": "measurement", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "measurement_location_id_location_id_fk", + "schema": "public", + "table": "measurement", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "password", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "password_user_id_user_id_fk", + "schema": "public", + "table": "password", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "password_reset_request", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "password_reset_request", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "password_reset_request", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "password_reset_request", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "nullsNotDistinct": false, + "name": "password_reset_request_user_id_unique", + "schema": "public", + "table": "password_reset_request", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "password_reset_request_user_id_user_id_fk", + "schema": "public", + "table": "password_reset_request", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_pkey", + "schema": "public", + "table": "profile", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "username", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "username" + ], + "nullsNotDistinct": false, + "name": "profile_username_unique", + "schema": "public", + "table": "profile", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_user_id_user_id_fk", + "schema": "public", + "table": "profile", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile_image", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_image_pkey", + "schema": "public", + "table": "profile_image", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "alt_text", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content_type", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "blob", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "profile_id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "profile_id" + ], + "schemaTo": "public", + "tableTo": "profile", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_image_profile_id_profile_id_fk", + "schema": "public", + "table": "profile_image", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "sensor", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "sensor_pkey", + "schema": "public", + "table": "sensor", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_phenomenon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastMeasurement", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "data", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "sensor_device_id_device_id_fk", + "schema": "public", + "table": "sensor", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "user", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "user_pkey", + "schema": "public", + "table": "user", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unconfirmed_email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'user'", + "generated": null, + "identity": null, + "name": "role", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'en_US'", + "generated": null, + "identity": null, + "name": "language", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "email_is_confirmed", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email_confirmation_token", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "email" + ], + "nullsNotDistinct": false, + "name": "user_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "unconfirmed_email" + ], + "nullsNotDistinct": false, + "name": "user_unconfirmed_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "isRlsEnabled": false, + "name": "location", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "location_pkey", + "schema": "public", + "table": "location", + "entityType": "pks" + }, + { + "type": "bigserial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "type": "geometry(point)", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "location" + ], + "nullsNotDistinct": false, + "name": "location_location_unique", + "schema": "public", + "table": "location", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "location", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "gist", + "concurrently": false, + "name": "location_index", + "schema": "public", + "table": "location", + "entityType": "indexes" + }, + { + "isRlsEnabled": false, + "name": "log_entry", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "log_entry_pkey", + "schema": "public", + "table": "log_entry", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "refresh_token", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "refresh_token_user_id_user_id_fk", + "schema": "public", + "table": "refresh_token", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "token_revocation", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "access_token", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "access_token", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "access_token", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "access_token_device_id_device_id_fk", + "schema": "public", + "table": "access_token", + "entityType": "fks" + }, + { + "values": [ + "indoor", + "outdoor", + "mobile", + "unknown" + ], + "name": "exposure", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "homeV2Lora", + "homeV2Ethernet", + "homeV2Wifi", + "senseBox:Edu", + "luftdaten.info", + "Custom" + ], + "name": "model", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "active", + "inactive", + "old" + ], + "name": "status", + "schema": "public", + "entityType": "enums" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/app/db/drizzle/0022_odd_sugar_man.sql b/app/db/drizzle/20251022083513_odd_sugar_man/migration.sql similarity index 100% rename from app/db/drizzle/0022_odd_sugar_man.sql rename to app/db/drizzle/20251022083513_odd_sugar_man/migration.sql diff --git a/app/db/drizzle/20251022083513_odd_sugar_man/snapshot.json b/app/db/drizzle/20251022083513_odd_sugar_man/snapshot.json new file mode 100644 index 000000000..7b6c7b9eb --- /dev/null +++ b/app/db/drizzle/20251022083513_odd_sugar_man/snapshot.json @@ -0,0 +1,1652 @@ +{ + "id": "95fc2b5e-a6d7-426d-bfd8-7c5238f5722b", + "prevIds": [ + "85481101-dd0d-4e15-9158-11971b8ba509" + ], + "version": "8", + "dialect": "postgres", + "ddl": [ + { + "isRlsEnabled": false, + "name": "device", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "device_pkey", + "schema": "public", + "table": "device", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "image", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 1, + "default": "ARRAY[]", + "generated": null, + "identity": null, + "name": "tags", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "link", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "use_auth", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "exposure", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "exposure", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "model", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "date", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "latitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "longitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "device_to_location", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "columns": [ + "device_id", + "location_id", + "time" + ], + "nameExplicit": false, + "name": "device_to_location_device_id_location_id_time_pk", + "schema": "public", + "table": "device_to_location", + "entityType": "pks" + }, + { + "nameExplicit": false, + "columns": [ + "device_id", + "location_id", + "time" + ], + "nullsNotDistinct": false, + "name": "device_to_location_device_id_location_id_time_unique", + "schema": "public", + "table": "device_to_location", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "device_to_location_device_id_device_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "device_to_location_location_id_location_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "measurement", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "timestamp (3) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "sensor_id", + "time" + ], + "nullsNotDistinct": false, + "name": "measurement_sensor_id_time_unique", + "schema": "public", + "table": "measurement", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "measurement_location_id_location_id_fk", + "schema": "public", + "table": "measurement", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "password", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "password_user_id_user_id_fk", + "schema": "public", + "table": "password", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "password_reset_request", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "password_reset_request", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "password_reset_request", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "password_reset_request", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "nullsNotDistinct": false, + "name": "password_reset_request_user_id_unique", + "schema": "public", + "table": "password_reset_request", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "password_reset_request_user_id_user_id_fk", + "schema": "public", + "table": "password_reset_request", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_pkey", + "schema": "public", + "table": "profile", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "username", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "username" + ], + "nullsNotDistinct": false, + "name": "profile_username_unique", + "schema": "public", + "table": "profile", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_user_id_user_id_fk", + "schema": "public", + "table": "profile", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile_image", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_image_pkey", + "schema": "public", + "table": "profile_image", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "alt_text", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content_type", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "blob", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "profile_id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "profile_id" + ], + "schemaTo": "public", + "tableTo": "profile", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_image_profile_id_profile_id_fk", + "schema": "public", + "table": "profile_image", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "sensor", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "sensor_pkey", + "schema": "public", + "table": "sensor", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_phenomenon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastMeasurement", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "data", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "sensor_device_id_device_id_fk", + "schema": "public", + "table": "sensor", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "user", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "user_pkey", + "schema": "public", + "table": "user", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unconfirmed_email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'user'", + "generated": null, + "identity": null, + "name": "role", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'en_US'", + "generated": null, + "identity": null, + "name": "language", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "email_is_confirmed", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email_confirmation_token", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "email" + ], + "nullsNotDistinct": false, + "name": "user_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "unconfirmed_email" + ], + "nullsNotDistinct": false, + "name": "user_unconfirmed_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "isRlsEnabled": false, + "name": "location", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "location_pkey", + "schema": "public", + "table": "location", + "entityType": "pks" + }, + { + "type": "bigserial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "type": "geometry(point)", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "location" + ], + "nullsNotDistinct": false, + "name": "location_location_unique", + "schema": "public", + "table": "location", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "location", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "gist", + "concurrently": false, + "name": "location_index", + "schema": "public", + "table": "location", + "entityType": "indexes" + }, + { + "isRlsEnabled": false, + "name": "log_entry", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "log_entry_pkey", + "schema": "public", + "table": "log_entry", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "refresh_token", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "refresh_token_user_id_user_id_fk", + "schema": "public", + "table": "refresh_token", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "token_revocation", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "claim", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "claim_pkey", + "schema": "public", + "table": "claim", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "box_id", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "nameExplicit": true, + "columns": [ + "box_id" + ], + "nullsNotDistinct": false, + "name": "unique_box_id", + "schema": "public", + "table": "claim", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "expires_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "claim_expires_at_idx", + "schema": "public", + "table": "claim", + "entityType": "indexes" + }, + { + "nameExplicit": false, + "columns": [ + "box_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "claim_box_id_device_id_fk", + "schema": "public", + "table": "claim", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "access_token", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "access_token", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "access_token", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "access_token_device_id_device_id_fk", + "schema": "public", + "table": "access_token", + "entityType": "fks" + }, + { + "values": [ + "indoor", + "outdoor", + "mobile", + "unknown" + ], + "name": "exposure", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "homeV2Lora", + "homeV2Ethernet", + "homeV2Wifi", + "senseBox:Edu", + "luftdaten.info", + "Custom" + ], + "name": "model", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "active", + "inactive", + "old" + ], + "name": "status", + "schema": "public", + "entityType": "enums" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/app/db/drizzle/0023_check_location.sql b/app/db/drizzle/20251210153234_check_location/migration.sql similarity index 100% rename from app/db/drizzle/0023_check_location.sql rename to app/db/drizzle/20251210153234_check_location/migration.sql diff --git a/app/db/drizzle/20251210153234_check_location/snapshot.json b/app/db/drizzle/20251210153234_check_location/snapshot.json new file mode 100644 index 000000000..78ccd6dac --- /dev/null +++ b/app/db/drizzle/20251210153234_check_location/snapshot.json @@ -0,0 +1,1652 @@ +{ + "id": "b7903c96-4a1f-498b-abb4-07815b2d42d8", + "prevIds": [ + "95fc2b5e-a6d7-426d-bfd8-7c5238f5722b" + ], + "version": "8", + "dialect": "postgres", + "ddl": [ + { + "isRlsEnabled": false, + "name": "device", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "device_pkey", + "schema": "public", + "table": "device", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "image", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 1, + "default": "ARRAY[]", + "generated": null, + "identity": null, + "name": "tags", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "link", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "use_auth", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "exposure", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "exposure", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "model", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "date", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "latitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "longitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "device_to_location", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "columns": [ + "device_id", + "location_id", + "time" + ], + "nameExplicit": false, + "name": "device_to_location_device_id_location_id_time_pk", + "schema": "public", + "table": "device_to_location", + "entityType": "pks" + }, + { + "nameExplicit": false, + "columns": [ + "device_id", + "location_id", + "time" + ], + "nullsNotDistinct": false, + "name": "device_to_location_device_id_location_id_time_unique", + "schema": "public", + "table": "device_to_location", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "device_to_location_device_id_device_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "device_to_location_location_id_location_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "measurement", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "timestamp (3) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "sensor_id", + "time" + ], + "nullsNotDistinct": false, + "name": "measurement_sensor_id_time_unique", + "schema": "public", + "table": "measurement", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "measurement_location_id_location_id_fk", + "schema": "public", + "table": "measurement", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "password", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "password_user_id_user_id_fk", + "schema": "public", + "table": "password", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "password_reset_request", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "password_reset_request", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "password_reset_request", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "password_reset_request", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "nullsNotDistinct": false, + "name": "password_reset_request_user_id_unique", + "schema": "public", + "table": "password_reset_request", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "password_reset_request_user_id_user_id_fk", + "schema": "public", + "table": "password_reset_request", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_pkey", + "schema": "public", + "table": "profile", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "username", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "username" + ], + "nullsNotDistinct": false, + "name": "profile_username_unique", + "schema": "public", + "table": "profile", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_user_id_user_id_fk", + "schema": "public", + "table": "profile", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile_image", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_image_pkey", + "schema": "public", + "table": "profile_image", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "alt_text", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content_type", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "blob", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "profile_id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "profile_id" + ], + "schemaTo": "public", + "tableTo": "profile", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_image_profile_id_profile_id_fk", + "schema": "public", + "table": "profile_image", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "sensor", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "sensor_pkey", + "schema": "public", + "table": "sensor", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_phenomenon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastMeasurement", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "data", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "sensor_device_id_device_id_fk", + "schema": "public", + "table": "sensor", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "user", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "user_pkey", + "schema": "public", + "table": "user", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unconfirmed_email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'user'", + "generated": null, + "identity": null, + "name": "role", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'en_US'", + "generated": null, + "identity": null, + "name": "language", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "email_is_confirmed", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email_confirmation_token", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "email" + ], + "nullsNotDistinct": false, + "name": "user_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "unconfirmed_email" + ], + "nullsNotDistinct": false, + "name": "user_unconfirmed_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "isRlsEnabled": false, + "name": "location", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "location_pkey", + "schema": "public", + "table": "location", + "entityType": "pks" + }, + { + "type": "bigserial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "type": "geometry(point)", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "location" + ], + "nullsNotDistinct": false, + "name": "location_location_unique", + "schema": "public", + "table": "location", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "location", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "gist", + "concurrently": false, + "name": "location_index", + "schema": "public", + "table": "location", + "entityType": "indexes" + }, + { + "isRlsEnabled": false, + "name": "log_entry", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "log_entry_pkey", + "schema": "public", + "table": "log_entry", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "refresh_token", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "refresh_token_user_id_user_id_fk", + "schema": "public", + "table": "refresh_token", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "token_revocation", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "claim", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "claim_pkey", + "schema": "public", + "table": "claim", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "box_id", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "nameExplicit": true, + "columns": [ + "box_id" + ], + "nullsNotDistinct": false, + "name": "unique_box_id", + "schema": "public", + "table": "claim", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "expires_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "claim_expires_at_idx", + "schema": "public", + "table": "claim", + "entityType": "indexes" + }, + { + "nameExplicit": false, + "columns": [ + "box_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "claim_box_id_device_id_fk", + "schema": "public", + "table": "claim", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "access_token", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "access_token", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "access_token", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "access_token_device_id_device_id_fk", + "schema": "public", + "table": "access_token", + "entityType": "fks" + }, + { + "values": [ + "indoor", + "outdoor", + "mobile", + "unknown" + ], + "name": "exposure", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "homeV2Lora", + "homeV2Ethernet", + "homeV2Wifi", + "senseBox:Edu", + "luftdaten.info", + "Custom" + ], + "name": "model", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "active", + "inactive", + "old" + ], + "name": "status", + "schema": "public", + "entityType": "enums" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/app/db/drizzle/0024_first_kitty_pryde.sql b/app/db/drizzle/20260109152213_first_kitty_pryde/migration.sql similarity index 100% rename from app/db/drizzle/0024_first_kitty_pryde.sql rename to app/db/drizzle/20260109152213_first_kitty_pryde/migration.sql diff --git a/app/db/drizzle/20260109152213_first_kitty_pryde/snapshot.json b/app/db/drizzle/20260109152213_first_kitty_pryde/snapshot.json new file mode 100644 index 000000000..564ce7e23 --- /dev/null +++ b/app/db/drizzle/20260109152213_first_kitty_pryde/snapshot.json @@ -0,0 +1,1675 @@ +{ + "id": "be35aeec-1a4d-449f-bbe9-b290b6a79093", + "prevIds": [ + "b7903c96-4a1f-498b-abb4-07815b2d42d8" + ], + "version": "8", + "dialect": "postgres", + "ddl": [ + { + "isRlsEnabled": false, + "name": "device", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "device_pkey", + "schema": "public", + "table": "device", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "image", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 1, + "default": "ARRAY[]", + "generated": null, + "identity": null, + "name": "tags", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "link", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "use_auth", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "exposure", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "exposure", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "model", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "date", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "latitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "longitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "device_to_location", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "columns": [ + "device_id", + "location_id", + "time" + ], + "nameExplicit": false, + "name": "device_to_location_device_id_location_id_time_pk", + "schema": "public", + "table": "device_to_location", + "entityType": "pks" + }, + { + "nameExplicit": false, + "columns": [ + "device_id", + "location_id", + "time" + ], + "nullsNotDistinct": false, + "name": "device_to_location_device_id_location_id_time_unique", + "schema": "public", + "table": "device_to_location", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "device_to_location_device_id_device_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "device_to_location_location_id_location_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "measurement", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "timestamp (3) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "sensor_id", + "time" + ], + "nullsNotDistinct": false, + "name": "measurement_sensor_id_time_unique", + "schema": "public", + "table": "measurement", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "measurement_location_id_location_id_fk", + "schema": "public", + "table": "measurement", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "password", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "password_user_id_user_id_fk", + "schema": "public", + "table": "password", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "password_reset_request", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "password_reset_request", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "password_reset_request", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "password_reset_request", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "nullsNotDistinct": false, + "name": "password_reset_request_user_id_unique", + "schema": "public", + "table": "password_reset_request", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "password_reset_request_user_id_user_id_fk", + "schema": "public", + "table": "password_reset_request", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_pkey", + "schema": "public", + "table": "profile", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "username", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "username" + ], + "nullsNotDistinct": false, + "name": "profile_username_unique", + "schema": "public", + "table": "profile", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_user_id_user_id_fk", + "schema": "public", + "table": "profile", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile_image", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_image_pkey", + "schema": "public", + "table": "profile_image", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "alt_text", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content_type", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "blob", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "profile_id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "profile_id" + ], + "schemaTo": "public", + "tableTo": "profile", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_image_profile_id_profile_id_fk", + "schema": "public", + "table": "profile_image", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "sensor", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "sensor_pkey", + "schema": "public", + "table": "sensor", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "icon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_phenomenon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastMeasurement", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "data", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "sensor_device_id_device_id_fk", + "schema": "public", + "table": "sensor", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "user", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "user_pkey", + "schema": "public", + "table": "user", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unconfirmed_email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'user'", + "generated": null, + "identity": null, + "name": "role", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'en_US'", + "generated": null, + "identity": null, + "name": "language", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "email_is_confirmed", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email_confirmation_token", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "email" + ], + "nullsNotDistinct": false, + "name": "user_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "unconfirmed_email" + ], + "nullsNotDistinct": false, + "name": "user_unconfirmed_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "isRlsEnabled": false, + "name": "location", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "location_pkey", + "schema": "public", + "table": "location", + "entityType": "pks" + }, + { + "type": "bigserial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "type": "geometry(point)", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "location" + ], + "nullsNotDistinct": false, + "name": "location_location_unique", + "schema": "public", + "table": "location", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "location", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "gist", + "concurrently": false, + "name": "location_index", + "schema": "public", + "table": "location", + "entityType": "indexes" + }, + { + "isRlsEnabled": false, + "name": "log_entry", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "log_entry_pkey", + "schema": "public", + "table": "log_entry", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "refresh_token", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "refresh_token_user_id_user_id_fk", + "schema": "public", + "table": "refresh_token", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "token_revocation", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "claim", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "claim_pkey", + "schema": "public", + "table": "claim", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "box_id", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "nameExplicit": true, + "columns": [ + "box_id" + ], + "nullsNotDistinct": false, + "name": "unique_box_id", + "schema": "public", + "table": "claim", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "expires_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "claim_expires_at_idx", + "schema": "public", + "table": "claim", + "entityType": "indexes" + }, + { + "nameExplicit": false, + "columns": [ + "box_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "claim_box_id_device_id_fk", + "schema": "public", + "table": "claim", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "access_token", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "access_token", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "access_token", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "access_token_device_id_device_id_fk", + "schema": "public", + "table": "access_token", + "entityType": "fks" + }, + { + "values": [ + "indoor", + "outdoor", + "mobile", + "unknown" + ], + "name": "exposure", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "homeV2Lora", + "homeV2Ethernet", + "homeV2Wifi", + "homeEthernet", + "homeWifi", + "homeEthernetFeinstaub", + "homeWifiFeinstaub", + "luftdaten_sds011", + "luftdaten_sds011_dht11", + "luftdaten_sds011_dht22", + "luftdaten_sds011_bmp180", + "luftdaten_sds011_bme280", + "hackair_home_v2", + "senseBox:Edu", + "luftdaten.info", + "Custom" + ], + "name": "model", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "active", + "inactive", + "old" + ], + "name": "status", + "schema": "public", + "entityType": "enums" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/app/db/drizzle/0025_check-location-update.sql b/app/db/drizzle/20260116173755_check-location-update/migration.sql similarity index 100% rename from app/db/drizzle/0025_check-location-update.sql rename to app/db/drizzle/20260116173755_check-location-update/migration.sql diff --git a/app/db/drizzle/20260116173755_check-location-update/snapshot.json b/app/db/drizzle/20260116173755_check-location-update/snapshot.json new file mode 100644 index 000000000..986ae311a --- /dev/null +++ b/app/db/drizzle/20260116173755_check-location-update/snapshot.json @@ -0,0 +1,1675 @@ +{ + "id": "8290e5ac-6df5-43de-99c2-23b42d7ba33e", + "prevIds": [ + "be35aeec-1a4d-449f-bbe9-b290b6a79093" + ], + "version": "8", + "dialect": "postgres", + "ddl": [ + { + "isRlsEnabled": false, + "name": "device", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "device_pkey", + "schema": "public", + "table": "device", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "image", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 1, + "default": "ARRAY[]", + "generated": null, + "identity": null, + "name": "tags", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "link", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "use_auth", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "exposure", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "exposure", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "model", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "date", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "latitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "longitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "device_to_location", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "columns": [ + "device_id", + "location_id", + "time" + ], + "nameExplicit": false, + "name": "device_to_location_device_id_location_id_time_pk", + "schema": "public", + "table": "device_to_location", + "entityType": "pks" + }, + { + "nameExplicit": false, + "columns": [ + "device_id", + "location_id", + "time" + ], + "nullsNotDistinct": false, + "name": "device_to_location_device_id_location_id_time_unique", + "schema": "public", + "table": "device_to_location", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "device_to_location_device_id_device_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "device_to_location_location_id_location_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "measurement", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "timestamp (3) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "sensor_id", + "time" + ], + "nullsNotDistinct": false, + "name": "measurement_sensor_id_time_unique", + "schema": "public", + "table": "measurement", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "measurement_location_id_location_id_fk", + "schema": "public", + "table": "measurement", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "password", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "password_user_id_user_id_fk", + "schema": "public", + "table": "password", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "password_reset_request", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "password_reset_request", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "password_reset_request", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "password_reset_request", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "nullsNotDistinct": false, + "name": "password_reset_request_user_id_unique", + "schema": "public", + "table": "password_reset_request", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "password_reset_request_user_id_user_id_fk", + "schema": "public", + "table": "password_reset_request", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_pkey", + "schema": "public", + "table": "profile", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "username", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "username" + ], + "nullsNotDistinct": false, + "name": "profile_username_unique", + "schema": "public", + "table": "profile", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_user_id_user_id_fk", + "schema": "public", + "table": "profile", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile_image", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_image_pkey", + "schema": "public", + "table": "profile_image", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "alt_text", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content_type", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "blob", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "profile_id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "profile_id" + ], + "schemaTo": "public", + "tableTo": "profile", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_image_profile_id_profile_id_fk", + "schema": "public", + "table": "profile_image", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "sensor", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "sensor_pkey", + "schema": "public", + "table": "sensor", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "icon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_phenomenon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastMeasurement", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "data", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "sensor_device_id_device_id_fk", + "schema": "public", + "table": "sensor", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "user", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "user_pkey", + "schema": "public", + "table": "user", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unconfirmed_email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'user'", + "generated": null, + "identity": null, + "name": "role", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'en_US'", + "generated": null, + "identity": null, + "name": "language", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "email_is_confirmed", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email_confirmation_token", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "email" + ], + "nullsNotDistinct": false, + "name": "user_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "unconfirmed_email" + ], + "nullsNotDistinct": false, + "name": "user_unconfirmed_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "isRlsEnabled": false, + "name": "location", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "location_pkey", + "schema": "public", + "table": "location", + "entityType": "pks" + }, + { + "type": "bigserial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "type": "geometry(point)", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "location" + ], + "nullsNotDistinct": false, + "name": "location_location_unique", + "schema": "public", + "table": "location", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "location", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "gist", + "concurrently": false, + "name": "location_index", + "schema": "public", + "table": "location", + "entityType": "indexes" + }, + { + "isRlsEnabled": false, + "name": "log_entry", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "log_entry_pkey", + "schema": "public", + "table": "log_entry", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "refresh_token", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "refresh_token_user_id_user_id_fk", + "schema": "public", + "table": "refresh_token", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "token_revocation", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "claim", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "claim_pkey", + "schema": "public", + "table": "claim", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "box_id", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "nameExplicit": true, + "columns": [ + "box_id" + ], + "nullsNotDistinct": false, + "name": "unique_box_id", + "schema": "public", + "table": "claim", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "expires_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "claim_expires_at_idx", + "schema": "public", + "table": "claim", + "entityType": "indexes" + }, + { + "nameExplicit": false, + "columns": [ + "box_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "claim_box_id_device_id_fk", + "schema": "public", + "table": "claim", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "access_token", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "access_token", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "access_token", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "access_token_device_id_device_id_fk", + "schema": "public", + "table": "access_token", + "entityType": "fks" + }, + { + "values": [ + "indoor", + "outdoor", + "mobile", + "unknown" + ], + "name": "exposure", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "homeV2Lora", + "homeV2Ethernet", + "homeV2Wifi", + "homeEthernet", + "homeWifi", + "homeEthernetFeinstaub", + "homeWifiFeinstaub", + "luftdaten_sds011", + "luftdaten_sds011_dht11", + "luftdaten_sds011_dht22", + "luftdaten_sds011_bmp180", + "luftdaten_sds011_bme280", + "hackair_home_v2", + "senseBox:Edu", + "luftdaten.info", + "Custom" + ], + "name": "model", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "active", + "inactive", + "old" + ], + "name": "status", + "schema": "public", + "entityType": "enums" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/app/db/drizzle/0026_misty_switch.sql b/app/db/drizzle/20260121101628_misty_switch/migration.sql similarity index 100% rename from app/db/drizzle/0026_misty_switch.sql rename to app/db/drizzle/20260121101628_misty_switch/migration.sql diff --git a/app/db/drizzle/20260121101628_misty_switch/snapshot.json b/app/db/drizzle/20260121101628_misty_switch/snapshot.json new file mode 100644 index 000000000..af92825b1 --- /dev/null +++ b/app/db/drizzle/20260121101628_misty_switch/snapshot.json @@ -0,0 +1,1688 @@ +{ + "id": "705f9077-6082-45cc-b539-3dab19aae432", + "prevIds": [ + "8290e5ac-6df5-43de-99c2-23b42d7ba33e" + ], + "version": "8", + "dialect": "postgres", + "ddl": [ + { + "isRlsEnabled": false, + "name": "device", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "device_pkey", + "schema": "public", + "table": "device", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "image", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "website", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 1, + "default": "ARRAY[]", + "generated": null, + "identity": null, + "name": "tags", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "link", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "use_auth", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "exposure", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "exposure", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "model", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "date", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "latitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "longitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "device_to_location", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "columns": [ + "device_id", + "location_id", + "time" + ], + "nameExplicit": false, + "name": "device_to_location_device_id_location_id_time_pk", + "schema": "public", + "table": "device_to_location", + "entityType": "pks" + }, + { + "nameExplicit": false, + "columns": [ + "device_id", + "location_id", + "time" + ], + "nullsNotDistinct": false, + "name": "device_to_location_device_id_location_id_time_unique", + "schema": "public", + "table": "device_to_location", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "device_to_location_device_id_device_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "device_to_location_location_id_location_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "measurement", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "timestamp (3) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "sensor_id", + "time" + ], + "nullsNotDistinct": false, + "name": "measurement_sensor_id_time_unique", + "schema": "public", + "table": "measurement", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "measurement_location_id_location_id_fk", + "schema": "public", + "table": "measurement", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "password", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "password_user_id_user_id_fk", + "schema": "public", + "table": "password", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "password_reset_request", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "password_reset_request", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "password_reset_request", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "password_reset_request", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "nullsNotDistinct": false, + "name": "password_reset_request_user_id_unique", + "schema": "public", + "table": "password_reset_request", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "password_reset_request_user_id_user_id_fk", + "schema": "public", + "table": "password_reset_request", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_pkey", + "schema": "public", + "table": "profile", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "username", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "username" + ], + "nullsNotDistinct": false, + "name": "profile_username_unique", + "schema": "public", + "table": "profile", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_user_id_user_id_fk", + "schema": "public", + "table": "profile", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile_image", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_image_pkey", + "schema": "public", + "table": "profile_image", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "alt_text", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content_type", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "blob", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "profile_id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "profile_id" + ], + "schemaTo": "public", + "tableTo": "profile", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_image_profile_id_profile_id_fk", + "schema": "public", + "table": "profile_image", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "sensor", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "sensor_pkey", + "schema": "public", + "table": "sensor", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "icon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_phenomenon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastMeasurement", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "data", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "sensor_device_id_device_id_fk", + "schema": "public", + "table": "sensor", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "user", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "user_pkey", + "schema": "public", + "table": "user", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unconfirmed_email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'user'", + "generated": null, + "identity": null, + "name": "role", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'en_US'", + "generated": null, + "identity": null, + "name": "language", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "email_is_confirmed", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email_confirmation_token", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "email" + ], + "nullsNotDistinct": false, + "name": "user_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "unconfirmed_email" + ], + "nullsNotDistinct": false, + "name": "user_unconfirmed_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "isRlsEnabled": false, + "name": "location", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "location_pkey", + "schema": "public", + "table": "location", + "entityType": "pks" + }, + { + "type": "bigserial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "type": "geometry(point)", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "location" + ], + "nullsNotDistinct": false, + "name": "location_location_unique", + "schema": "public", + "table": "location", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "location", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "gist", + "concurrently": false, + "name": "location_index", + "schema": "public", + "table": "location", + "entityType": "indexes" + }, + { + "isRlsEnabled": false, + "name": "log_entry", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "log_entry_pkey", + "schema": "public", + "table": "log_entry", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "refresh_token", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "refresh_token_user_id_user_id_fk", + "schema": "public", + "table": "refresh_token", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "token_revocation", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "claim", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "claim_pkey", + "schema": "public", + "table": "claim", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "box_id", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "nameExplicit": true, + "columns": [ + "box_id" + ], + "nullsNotDistinct": false, + "name": "unique_box_id", + "schema": "public", + "table": "claim", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "expires_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "claim_expires_at_idx", + "schema": "public", + "table": "claim", + "entityType": "indexes" + }, + { + "nameExplicit": false, + "columns": [ + "box_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "claim_box_id_device_id_fk", + "schema": "public", + "table": "claim", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "access_token", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "access_token", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "access_token", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "access_token_device_id_device_id_fk", + "schema": "public", + "table": "access_token", + "entityType": "fks" + }, + { + "values": [ + "indoor", + "outdoor", + "mobile", + "unknown" + ], + "name": "exposure", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "homeV2Lora", + "homeV2Ethernet", + "homeV2Wifi", + "homeEthernet", + "homeWifi", + "homeEthernetFeinstaub", + "homeWifiFeinstaub", + "luftdaten_sds011", + "luftdaten_sds011_dht11", + "luftdaten_sds011_dht22", + "luftdaten_sds011_bmp180", + "luftdaten_sds011_bme280", + "hackair_home_v2", + "senseBox:Edu", + "luftdaten.info", + "Custom" + ], + "name": "model", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "active", + "inactive", + "old" + ], + "name": "status", + "schema": "public", + "entityType": "enums" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/app/db/drizzle/0027_ambiguous_mariko_yashida.sql b/app/db/drizzle/20260127085523_ambiguous_mariko_yashida/migration.sql similarity index 100% rename from app/db/drizzle/0027_ambiguous_mariko_yashida.sql rename to app/db/drizzle/20260127085523_ambiguous_mariko_yashida/migration.sql diff --git a/app/db/drizzle/20260127085523_ambiguous_mariko_yashida/snapshot.json b/app/db/drizzle/20260127085523_ambiguous_mariko_yashida/snapshot.json new file mode 100644 index 000000000..e53ce05e7 --- /dev/null +++ b/app/db/drizzle/20260127085523_ambiguous_mariko_yashida/snapshot.json @@ -0,0 +1,1688 @@ +{ + "id": "5143b70f-657d-4617-af40-c0234803f6ee", + "prevIds": [ + "705f9077-6082-45cc-b539-3dab19aae432" + ], + "version": "8", + "dialect": "postgres", + "ddl": [ + { + "isRlsEnabled": false, + "name": "device", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "device_pkey", + "schema": "public", + "table": "device", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "image", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "website", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 1, + "default": "ARRAY[]", + "generated": null, + "identity": null, + "name": "tags", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "link", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "use_auth", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "exposure", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "exposure", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "model", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "date", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "latitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "longitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "device_to_location", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "columns": [ + "device_id", + "location_id", + "time" + ], + "nameExplicit": false, + "name": "device_to_location_device_id_location_id_time_pk", + "schema": "public", + "table": "device_to_location", + "entityType": "pks" + }, + { + "nameExplicit": false, + "columns": [ + "device_id", + "location_id", + "time" + ], + "nullsNotDistinct": false, + "name": "device_to_location_device_id_location_id_time_unique", + "schema": "public", + "table": "device_to_location", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "device_to_location_device_id_device_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "device_to_location_location_id_location_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "measurement", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "timestamp (3) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "sensor_id", + "time" + ], + "nullsNotDistinct": false, + "name": "measurement_sensor_id_time_unique", + "schema": "public", + "table": "measurement", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "measurement_location_id_location_id_fk", + "schema": "public", + "table": "measurement", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "password", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "password_user_id_user_id_fk", + "schema": "public", + "table": "password", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "password_reset_request", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "password_reset_request", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "password_reset_request", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "password_reset_request", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "nullsNotDistinct": false, + "name": "password_reset_request_user_id_unique", + "schema": "public", + "table": "password_reset_request", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "password_reset_request_user_id_user_id_fk", + "schema": "public", + "table": "password_reset_request", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_pkey", + "schema": "public", + "table": "profile", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "username", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "username" + ], + "nullsNotDistinct": false, + "name": "profile_username_unique", + "schema": "public", + "table": "profile", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_user_id_user_id_fk", + "schema": "public", + "table": "profile", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile_image", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_image_pkey", + "schema": "public", + "table": "profile_image", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "alt_text", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content_type", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "blob", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "profile_id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "profile_id" + ], + "schemaTo": "public", + "tableTo": "profile", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_image_profile_id_profile_id_fk", + "schema": "public", + "table": "profile_image", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "sensor", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "sensor_pkey", + "schema": "public", + "table": "sensor", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "icon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_phenomenon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastMeasurement", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "data", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "sensor_device_id_device_id_fk", + "schema": "public", + "table": "sensor", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "user", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "user_pkey", + "schema": "public", + "table": "user", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unconfirmed_email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'user'", + "generated": null, + "identity": null, + "name": "role", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'en_US'", + "generated": null, + "identity": null, + "name": "language", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "email_is_confirmed", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email_confirmation_token", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "email" + ], + "nullsNotDistinct": false, + "name": "user_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "unconfirmed_email" + ], + "nullsNotDistinct": false, + "name": "user_unconfirmed_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "isRlsEnabled": false, + "name": "location", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "location_pkey", + "schema": "public", + "table": "location", + "entityType": "pks" + }, + { + "type": "bigserial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "type": "geometry(point)", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "location" + ], + "nullsNotDistinct": false, + "name": "location_location_unique", + "schema": "public", + "table": "location", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "location", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "gist", + "concurrently": false, + "name": "location_index", + "schema": "public", + "table": "location", + "entityType": "indexes" + }, + { + "isRlsEnabled": false, + "name": "log_entry", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "log_entry_pkey", + "schema": "public", + "table": "log_entry", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "refresh_token", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "refresh_token_user_id_user_id_fk", + "schema": "public", + "table": "refresh_token", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "token_revocation", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "claim", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "claim_pkey", + "schema": "public", + "table": "claim", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "box_id", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "nameExplicit": true, + "columns": [ + "box_id" + ], + "nullsNotDistinct": false, + "name": "unique_box_id", + "schema": "public", + "table": "claim", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "expires_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "claim_expires_at_idx", + "schema": "public", + "table": "claim", + "entityType": "indexes" + }, + { + "nameExplicit": false, + "columns": [ + "box_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "claim_box_id_device_id_fk", + "schema": "public", + "table": "claim", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "access_token", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "access_token", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "access_token", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "access_token_device_id_device_id_fk", + "schema": "public", + "table": "access_token", + "entityType": "fks" + }, + { + "values": [ + "indoor", + "outdoor", + "mobile", + "unknown" + ], + "name": "exposure", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "homeV2Lora", + "homeV2Ethernet", + "homeV2Wifi", + "homeEthernet", + "homeWifi", + "homeEthernetFeinstaub", + "homeWifiFeinstaub", + "luftdaten_sds011", + "luftdaten_sds011_dht11", + "luftdaten_sds011_dht22", + "luftdaten_sds011_bmp180", + "luftdaten_sds011_bme280", + "hackair_home_v2", + "senseBox:Edu", + "luftdaten.info", + "custom" + ], + "name": "model", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "active", + "inactive", + "old" + ], + "name": "status", + "schema": "public", + "entityType": "enums" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/app/db/drizzle/0028_gigantic_deadpool.sql b/app/db/drizzle/20260127090910_gigantic_deadpool/migration.sql similarity index 100% rename from app/db/drizzle/0028_gigantic_deadpool.sql rename to app/db/drizzle/20260127090910_gigantic_deadpool/migration.sql diff --git a/app/db/drizzle/20260127090910_gigantic_deadpool/snapshot.json b/app/db/drizzle/20260127090910_gigantic_deadpool/snapshot.json new file mode 100644 index 000000000..9d804d848 --- /dev/null +++ b/app/db/drizzle/20260127090910_gigantic_deadpool/snapshot.json @@ -0,0 +1,1688 @@ +{ + "id": "d622d4a4-5722-4b7f-b22f-8c5184ad7148", + "prevIds": [ + "5143b70f-657d-4617-af40-c0234803f6ee" + ], + "version": "8", + "dialect": "postgres", + "ddl": [ + { + "isRlsEnabled": false, + "name": "device", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "device_pkey", + "schema": "public", + "table": "device", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "image", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "website", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 1, + "default": "ARRAY[]", + "generated": null, + "identity": null, + "name": "tags", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "link", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "use_auth", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "exposure", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "exposure", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "model", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'custom'", + "generated": null, + "identity": null, + "name": "model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "date", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "latitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "longitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "device_to_location", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "columns": [ + "device_id", + "location_id", + "time" + ], + "nameExplicit": false, + "name": "device_to_location_device_id_location_id_time_pk", + "schema": "public", + "table": "device_to_location", + "entityType": "pks" + }, + { + "nameExplicit": false, + "columns": [ + "device_id", + "location_id", + "time" + ], + "nullsNotDistinct": false, + "name": "device_to_location_device_id_location_id_time_unique", + "schema": "public", + "table": "device_to_location", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "device_to_location_device_id_device_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "device_to_location_location_id_location_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "measurement", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "timestamp (3) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "sensor_id", + "time" + ], + "nullsNotDistinct": false, + "name": "measurement_sensor_id_time_unique", + "schema": "public", + "table": "measurement", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "measurement_location_id_location_id_fk", + "schema": "public", + "table": "measurement", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "password", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "password_user_id_user_id_fk", + "schema": "public", + "table": "password", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "password_reset_request", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "password_reset_request", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "password_reset_request", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "password_reset_request", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "nullsNotDistinct": false, + "name": "password_reset_request_user_id_unique", + "schema": "public", + "table": "password_reset_request", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "password_reset_request_user_id_user_id_fk", + "schema": "public", + "table": "password_reset_request", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_pkey", + "schema": "public", + "table": "profile", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "username", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "username" + ], + "nullsNotDistinct": false, + "name": "profile_username_unique", + "schema": "public", + "table": "profile", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_user_id_user_id_fk", + "schema": "public", + "table": "profile", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile_image", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_image_pkey", + "schema": "public", + "table": "profile_image", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "alt_text", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content_type", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "blob", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "profile_id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "profile_id" + ], + "schemaTo": "public", + "tableTo": "profile", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_image_profile_id_profile_id_fk", + "schema": "public", + "table": "profile_image", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "sensor", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "sensor_pkey", + "schema": "public", + "table": "sensor", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "icon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_phenomenon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastMeasurement", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "data", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "sensor_device_id_device_id_fk", + "schema": "public", + "table": "sensor", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "user", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "user_pkey", + "schema": "public", + "table": "user", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unconfirmed_email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'user'", + "generated": null, + "identity": null, + "name": "role", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'en_US'", + "generated": null, + "identity": null, + "name": "language", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "email_is_confirmed", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email_confirmation_token", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "email" + ], + "nullsNotDistinct": false, + "name": "user_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "unconfirmed_email" + ], + "nullsNotDistinct": false, + "name": "user_unconfirmed_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "isRlsEnabled": false, + "name": "location", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "location_pkey", + "schema": "public", + "table": "location", + "entityType": "pks" + }, + { + "type": "bigserial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "type": "geometry(point)", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "location" + ], + "nullsNotDistinct": false, + "name": "location_location_unique", + "schema": "public", + "table": "location", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "location", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "gist", + "concurrently": false, + "name": "location_index", + "schema": "public", + "table": "location", + "entityType": "indexes" + }, + { + "isRlsEnabled": false, + "name": "log_entry", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "log_entry_pkey", + "schema": "public", + "table": "log_entry", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "refresh_token", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "refresh_token_user_id_user_id_fk", + "schema": "public", + "table": "refresh_token", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "token_revocation", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "claim", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "claim_pkey", + "schema": "public", + "table": "claim", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "box_id", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "nameExplicit": true, + "columns": [ + "box_id" + ], + "nullsNotDistinct": false, + "name": "unique_box_id", + "schema": "public", + "table": "claim", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "expires_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "claim_expires_at_idx", + "schema": "public", + "table": "claim", + "entityType": "indexes" + }, + { + "nameExplicit": false, + "columns": [ + "box_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "claim_box_id_device_id_fk", + "schema": "public", + "table": "claim", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "access_token", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "access_token", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "access_token", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "access_token_device_id_device_id_fk", + "schema": "public", + "table": "access_token", + "entityType": "fks" + }, + { + "values": [ + "indoor", + "outdoor", + "mobile", + "unknown" + ], + "name": "exposure", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "homeV2Lora", + "homeV2Ethernet", + "homeV2Wifi", + "homeEthernet", + "homeWifi", + "homeEthernetFeinstaub", + "homeWifiFeinstaub", + "luftdaten_sds011", + "luftdaten_sds011_dht11", + "luftdaten_sds011_dht22", + "luftdaten_sds011_bmp180", + "luftdaten_sds011_bme280", + "hackair_home_v2", + "senseBox:Edu", + "luftdaten.info", + "custom" + ], + "name": "model", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "active", + "inactive", + "old" + ], + "name": "status", + "schema": "public", + "entityType": "enums" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/app/db/drizzle/0029_plain_black_widow.sql b/app/db/drizzle/20260205095242_plain_black_widow/migration.sql similarity index 100% rename from app/db/drizzle/0029_plain_black_widow.sql rename to app/db/drizzle/20260205095242_plain_black_widow/migration.sql diff --git a/app/db/drizzle/20260205095242_plain_black_widow/snapshot.json b/app/db/drizzle/20260205095242_plain_black_widow/snapshot.json new file mode 100644 index 000000000..6e0f671e2 --- /dev/null +++ b/app/db/drizzle/20260205095242_plain_black_widow/snapshot.json @@ -0,0 +1,1688 @@ +{ + "id": "825b79a1-9079-4a5e-83ea-864930b0f7b7", + "prevIds": [ + "d622d4a4-5722-4b7f-b22f-8c5184ad7148" + ], + "version": "8", + "dialect": "postgres", + "ddl": [ + { + "isRlsEnabled": false, + "name": "device", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "device_pkey", + "schema": "public", + "table": "device", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "image", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "website", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 1, + "default": "ARRAY[]", + "generated": null, + "identity": null, + "name": "tags", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "link", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "use_auth", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "exposure", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "exposure", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "model", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'custom'", + "generated": null, + "identity": null, + "name": "model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "date", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "latitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "longitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "device_to_location", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "columns": [ + "device_id", + "location_id", + "time" + ], + "nameExplicit": false, + "name": "device_to_location_device_id_location_id_time_pk", + "schema": "public", + "table": "device_to_location", + "entityType": "pks" + }, + { + "nameExplicit": false, + "columns": [ + "device_id", + "location_id", + "time" + ], + "nullsNotDistinct": false, + "name": "device_to_location_device_id_location_id_time_unique", + "schema": "public", + "table": "device_to_location", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "device_to_location_device_id_device_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "device_to_location_location_id_location_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "measurement", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "timestamp (3) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "sensor_id", + "time" + ], + "nullsNotDistinct": false, + "name": "measurement_sensor_id_time_unique", + "schema": "public", + "table": "measurement", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "measurement_location_id_location_id_fk", + "schema": "public", + "table": "measurement", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "password", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "password_user_id_user_id_fk", + "schema": "public", + "table": "password", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "password_reset_request", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "password_reset_request", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "password_reset_request", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "password_reset_request", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "nullsNotDistinct": false, + "name": "password_reset_request_user_id_unique", + "schema": "public", + "table": "password_reset_request", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "password_reset_request_user_id_user_id_fk", + "schema": "public", + "table": "password_reset_request", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_pkey", + "schema": "public", + "table": "profile", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "username", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "username" + ], + "nullsNotDistinct": false, + "name": "profile_username_unique", + "schema": "public", + "table": "profile", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_user_id_user_id_fk", + "schema": "public", + "table": "profile", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile_image", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_image_pkey", + "schema": "public", + "table": "profile_image", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "alt_text", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content_type", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "blob", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "profile_id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "profile_id" + ], + "schemaTo": "public", + "tableTo": "profile", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_image_profile_id_profile_id_fk", + "schema": "public", + "table": "profile_image", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "sensor", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "sensor_pkey", + "schema": "public", + "table": "sensor", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "icon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_phenomenon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastMeasurement", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "data", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "sensor_device_id_device_id_fk", + "schema": "public", + "table": "sensor", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "user", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "user_pkey", + "schema": "public", + "table": "user", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unconfirmed_email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'user'", + "generated": null, + "identity": null, + "name": "role", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'en_US'", + "generated": null, + "identity": null, + "name": "language", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "email_is_confirmed", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email_confirmation_token", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "email" + ], + "nullsNotDistinct": false, + "name": "user_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "unconfirmed_email" + ], + "nullsNotDistinct": false, + "name": "user_unconfirmed_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "isRlsEnabled": false, + "name": "location", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "location_pkey", + "schema": "public", + "table": "location", + "entityType": "pks" + }, + { + "type": "bigserial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "type": "geometry(point)", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "location" + ], + "nullsNotDistinct": false, + "name": "location_location_unique", + "schema": "public", + "table": "location", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "location", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "gist", + "concurrently": false, + "name": "location_index", + "schema": "public", + "table": "location", + "entityType": "indexes" + }, + { + "isRlsEnabled": false, + "name": "log_entry", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "log_entry_pkey", + "schema": "public", + "table": "log_entry", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "refresh_token", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "refresh_token_user_id_user_id_fk", + "schema": "public", + "table": "refresh_token", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "token_revocation", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "claim", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "claim_pkey", + "schema": "public", + "table": "claim", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "box_id", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "nameExplicit": true, + "columns": [ + "box_id" + ], + "nullsNotDistinct": false, + "name": "unique_box_id", + "schema": "public", + "table": "claim", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "expires_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "claim_expires_at_idx", + "schema": "public", + "table": "claim", + "entityType": "indexes" + }, + { + "nameExplicit": false, + "columns": [ + "box_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "claim_box_id_device_id_fk", + "schema": "public", + "table": "claim", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "device_api_key", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "device_api_key", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "api_key", + "schema": "public", + "table": "device_api_key", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "device_api_key_device_id_device_id_fk", + "schema": "public", + "table": "device_api_key", + "entityType": "fks" + }, + { + "values": [ + "indoor", + "outdoor", + "mobile", + "unknown" + ], + "name": "exposure", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "homeV2Lora", + "homeV2Ethernet", + "homeV2Wifi", + "homeEthernet", + "homeWifi", + "homeEthernetFeinstaub", + "homeWifiFeinstaub", + "luftdaten_sds011", + "luftdaten_sds011_dht11", + "luftdaten_sds011_dht22", + "luftdaten_sds011_bmp180", + "luftdaten_sds011_bme280", + "hackair_home_v2", + "senseBox:Edu", + "luftdaten.info", + "custom" + ], + "name": "model", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "active", + "inactive", + "old" + ], + "name": "status", + "schema": "public", + "entityType": "enums" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/app/db/drizzle/0030_parallel_toxin.sql b/app/db/drizzle/20260205150521_parallel_toxin/migration.sql similarity index 100% rename from app/db/drizzle/0030_parallel_toxin.sql rename to app/db/drizzle/20260205150521_parallel_toxin/migration.sql diff --git a/app/db/drizzle/20260205150521_parallel_toxin/snapshot.json b/app/db/drizzle/20260205150521_parallel_toxin/snapshot.json new file mode 100644 index 000000000..8e2ff69d0 --- /dev/null +++ b/app/db/drizzle/20260205150521_parallel_toxin/snapshot.json @@ -0,0 +1,1652 @@ +{ + "id": "962a5afc-671c-43ef-b967-5571d0fc3776", + "prevIds": [ + "825b79a1-9079-4a5e-83ea-864930b0f7b7" + ], + "version": "8", + "dialect": "postgres", + "ddl": [ + { + "isRlsEnabled": false, + "name": "device", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "device_pkey", + "schema": "public", + "table": "device", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "image", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "website", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 1, + "default": "ARRAY[]", + "generated": null, + "identity": null, + "name": "tags", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "link", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "use_auth", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "apiKey", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "exposure", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "exposure", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "model", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'custom'", + "generated": null, + "identity": null, + "name": "model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "date", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "latitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "longitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "device_to_location", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "columns": [ + "device_id", + "location_id", + "time" + ], + "nameExplicit": false, + "name": "device_to_location_device_id_location_id_time_pk", + "schema": "public", + "table": "device_to_location", + "entityType": "pks" + }, + { + "nameExplicit": false, + "columns": [ + "device_id", + "location_id", + "time" + ], + "nullsNotDistinct": false, + "name": "device_to_location_device_id_location_id_time_unique", + "schema": "public", + "table": "device_to_location", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "device_to_location_device_id_device_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "device_to_location_location_id_location_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "measurement", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "timestamp (3) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "sensor_id", + "time" + ], + "nullsNotDistinct": false, + "name": "measurement_sensor_id_time_unique", + "schema": "public", + "table": "measurement", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "measurement_location_id_location_id_fk", + "schema": "public", + "table": "measurement", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "password", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "password_user_id_user_id_fk", + "schema": "public", + "table": "password", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "password_reset_request", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "password_reset_request", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "password_reset_request", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "password_reset_request", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "nullsNotDistinct": false, + "name": "password_reset_request_user_id_unique", + "schema": "public", + "table": "password_reset_request", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "password_reset_request_user_id_user_id_fk", + "schema": "public", + "table": "password_reset_request", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_pkey", + "schema": "public", + "table": "profile", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "username", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "username" + ], + "nullsNotDistinct": false, + "name": "profile_username_unique", + "schema": "public", + "table": "profile", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_user_id_user_id_fk", + "schema": "public", + "table": "profile", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile_image", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_image_pkey", + "schema": "public", + "table": "profile_image", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "alt_text", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content_type", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "blob", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "profile_id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "profile_id" + ], + "schemaTo": "public", + "tableTo": "profile", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_image_profile_id_profile_id_fk", + "schema": "public", + "table": "profile_image", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "sensor", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "sensor_pkey", + "schema": "public", + "table": "sensor", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "icon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_phenomenon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastMeasurement", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "data", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "sensor_device_id_device_id_fk", + "schema": "public", + "table": "sensor", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "user", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "user_pkey", + "schema": "public", + "table": "user", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unconfirmed_email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'user'", + "generated": null, + "identity": null, + "name": "role", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'en_US'", + "generated": null, + "identity": null, + "name": "language", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "email_is_confirmed", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email_confirmation_token", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "email" + ], + "nullsNotDistinct": false, + "name": "user_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "unconfirmed_email" + ], + "nullsNotDistinct": false, + "name": "user_unconfirmed_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "isRlsEnabled": false, + "name": "location", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "location_pkey", + "schema": "public", + "table": "location", + "entityType": "pks" + }, + { + "type": "bigserial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "type": "geometry(point)", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "location" + ], + "nullsNotDistinct": false, + "name": "location_location_unique", + "schema": "public", + "table": "location", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "location", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "gist", + "concurrently": false, + "name": "location_index", + "schema": "public", + "table": "location", + "entityType": "indexes" + }, + { + "isRlsEnabled": false, + "name": "log_entry", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "log_entry_pkey", + "schema": "public", + "table": "log_entry", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "refresh_token", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "refresh_token_user_id_user_id_fk", + "schema": "public", + "table": "refresh_token", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "token_revocation", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "claim", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "claim_pkey", + "schema": "public", + "table": "claim", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "box_id", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "nameExplicit": true, + "columns": [ + "box_id" + ], + "nullsNotDistinct": false, + "name": "unique_box_id", + "schema": "public", + "table": "claim", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "expires_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "claim_expires_at_idx", + "schema": "public", + "table": "claim", + "entityType": "indexes" + }, + { + "nameExplicit": false, + "columns": [ + "box_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "claim_box_id_device_id_fk", + "schema": "public", + "table": "claim", + "entityType": "fks" + }, + { + "values": [ + "indoor", + "outdoor", + "mobile", + "unknown" + ], + "name": "exposure", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "homeV2Lora", + "homeV2Ethernet", + "homeV2Wifi", + "homeEthernet", + "homeWifi", + "homeEthernetFeinstaub", + "homeWifiFeinstaub", + "luftdaten_sds011", + "luftdaten_sds011_dht11", + "luftdaten_sds011_dht22", + "luftdaten_sds011_bmp180", + "luftdaten_sds011_bme280", + "hackair_home_v2", + "senseBox:Edu", + "luftdaten.info", + "custom" + ], + "name": "model", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "active", + "inactive", + "old" + ], + "name": "status", + "schema": "public", + "entityType": "enums" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/app/db/drizzle/0031_silly_the_call.sql b/app/db/drizzle/20260217112953_silly_the_call/migration.sql similarity index 100% rename from app/db/drizzle/0031_silly_the_call.sql rename to app/db/drizzle/20260217112953_silly_the_call/migration.sql diff --git a/app/db/drizzle/20260217112953_silly_the_call/snapshot.json b/app/db/drizzle/20260217112953_silly_the_call/snapshot.json new file mode 100644 index 000000000..9c19c51fc --- /dev/null +++ b/app/db/drizzle/20260217112953_silly_the_call/snapshot.json @@ -0,0 +1,1796 @@ +{ + "id": "09759b9c-faa8-4f1f-ac8f-7ea3e78edcb4", + "prevIds": [ + "962a5afc-671c-43ef-b967-5571d0fc3776" + ], + "version": "8", + "dialect": "postgres", + "ddl": [ + { + "isRlsEnabled": false, + "name": "device", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "device_pkey", + "schema": "public", + "table": "device", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "image", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "website", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 1, + "default": "ARRAY[]", + "generated": null, + "identity": null, + "name": "tags", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "link", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "use_auth", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "apiKey", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "exposure", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "exposure", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "model", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'custom'", + "generated": null, + "identity": null, + "name": "model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "date", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "latitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "longitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "device_to_location", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "columns": [ + "device_id", + "location_id", + "time" + ], + "nameExplicit": false, + "name": "device_to_location_device_id_location_id_time_pk", + "schema": "public", + "table": "device_to_location", + "entityType": "pks" + }, + { + "nameExplicit": false, + "columns": [ + "device_id", + "location_id", + "time" + ], + "nullsNotDistinct": false, + "name": "device_to_location_device_id_location_id_time_unique", + "schema": "public", + "table": "device_to_location", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "device_to_location_device_id_device_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "device_to_location_location_id_location_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "measurement", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "timestamp (3) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "sensor_id", + "time" + ], + "nullsNotDistinct": false, + "name": "measurement_sensor_id_time_unique", + "schema": "public", + "table": "measurement", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "measurement_location_id_location_id_fk", + "schema": "public", + "table": "measurement", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "password", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "password_user_id_user_id_fk", + "schema": "public", + "table": "password", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "password_reset_request", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "password_reset_request", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "password_reset_request", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "password_reset_request", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "nullsNotDistinct": false, + "name": "password_reset_request_user_id_unique", + "schema": "public", + "table": "password_reset_request", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "password_reset_request_user_id_user_id_fk", + "schema": "public", + "table": "password_reset_request", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_pkey", + "schema": "public", + "table": "profile", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "username", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "username" + ], + "nullsNotDistinct": false, + "name": "profile_username_unique", + "schema": "public", + "table": "profile", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_user_id_user_id_fk", + "schema": "public", + "table": "profile", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile_image", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_image_pkey", + "schema": "public", + "table": "profile_image", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "alt_text", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content_type", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "blob", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "profile_id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "profile_id" + ], + "schemaTo": "public", + "tableTo": "profile", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_image_profile_id_profile_id_fk", + "schema": "public", + "table": "profile_image", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "sensor", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "sensor_pkey", + "schema": "public", + "table": "sensor", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "icon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_phenomenon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastMeasurement", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "data", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "sensor_device_id_device_id_fk", + "schema": "public", + "table": "sensor", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "user", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "user_pkey", + "schema": "public", + "table": "user", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unconfirmed_email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'user'", + "generated": null, + "identity": null, + "name": "role", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'en_US'", + "generated": null, + "identity": null, + "name": "language", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "email_is_confirmed", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email_confirmation_token", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "email" + ], + "nullsNotDistinct": false, + "name": "user_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "unconfirmed_email" + ], + "nullsNotDistinct": false, + "name": "user_unconfirmed_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "isRlsEnabled": false, + "name": "location", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "location_pkey", + "schema": "public", + "table": "location", + "entityType": "pks" + }, + { + "type": "bigserial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "type": "geometry(point)", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "location" + ], + "nullsNotDistinct": false, + "name": "location_location_unique", + "schema": "public", + "table": "location", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "location", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "gist", + "concurrently": false, + "name": "location_index", + "schema": "public", + "table": "location", + "entityType": "indexes" + }, + { + "isRlsEnabled": false, + "name": "log_entry", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "log_entry_pkey", + "schema": "public", + "table": "log_entry", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "refresh_token", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "refresh_token_user_id_user_id_fk", + "schema": "public", + "table": "refresh_token", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "token_revocation", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "claim", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "claim_pkey", + "schema": "public", + "table": "claim", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "box_id", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "nameExplicit": true, + "columns": [ + "box_id" + ], + "nullsNotDistinct": false, + "name": "unique_box_id", + "schema": "public", + "table": "claim", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "expires_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "claim_expires_at_idx", + "schema": "public", + "table": "claim", + "entityType": "indexes" + }, + { + "nameExplicit": false, + "columns": [ + "box_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "claim_box_id_device_id_fk", + "schema": "public", + "table": "claim", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "integration", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "integration_pkey", + "schema": "public", + "table": "integration", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "slug", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "service_url", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "service_key", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "icon", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "order", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "slug" + ], + "nullsNotDistinct": false, + "name": "integration_slug_unique", + "schema": "public", + "table": "integration", + "entityType": "uniques" + }, + { + "values": [ + "indoor", + "outdoor", + "mobile", + "unknown" + ], + "name": "exposure", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "homeV2Lora", + "homeV2Ethernet", + "homeV2Wifi", + "homeEthernet", + "homeWifi", + "homeEthernetFeinstaub", + "homeWifiFeinstaub", + "luftdaten_sds011", + "luftdaten_sds011_dht11", + "luftdaten_sds011_dht22", + "luftdaten_sds011_bmp180", + "luftdaten_sds011_bme280", + "hackair_home_v2", + "senseBox:Edu", + "luftdaten.info", + "custom" + ], + "name": "model", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "active", + "inactive", + "old" + ], + "name": "status", + "schema": "public", + "entityType": "enums" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/app/db/drizzle/0032_equal_young_avengers.sql b/app/db/drizzle/20260217124150_equal_young_avengers/migration.sql similarity index 100% rename from app/db/drizzle/0032_equal_young_avengers.sql rename to app/db/drizzle/20260217124150_equal_young_avengers/migration.sql diff --git a/app/db/drizzle/20260217124150_equal_young_avengers/snapshot.json b/app/db/drizzle/20260217124150_equal_young_avengers/snapshot.json new file mode 100644 index 000000000..d5f316dc7 --- /dev/null +++ b/app/db/drizzle/20260217124150_equal_young_avengers/snapshot.json @@ -0,0 +1,1796 @@ +{ + "id": "d10e9d1c-dc82-4f0a-b93c-8810a746fe55", + "prevIds": [ + "09759b9c-faa8-4f1f-ac8f-7ea3e78edcb4" + ], + "version": "8", + "dialect": "postgres", + "ddl": [ + { + "isRlsEnabled": false, + "name": "device", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "device_pkey", + "schema": "public", + "table": "device", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "image", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "website", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 1, + "default": "ARRAY[]", + "generated": null, + "identity": null, + "name": "tags", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "link", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "use_auth", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "apiKey", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "exposure", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "exposure", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "model", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'custom'", + "generated": null, + "identity": null, + "name": "model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "date", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "latitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "longitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "device_to_location", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "columns": [ + "device_id", + "location_id", + "time" + ], + "nameExplicit": false, + "name": "device_to_location_device_id_location_id_time_pk", + "schema": "public", + "table": "device_to_location", + "entityType": "pks" + }, + { + "nameExplicit": false, + "columns": [ + "device_id", + "location_id", + "time" + ], + "nullsNotDistinct": false, + "name": "device_to_location_device_id_location_id_time_unique", + "schema": "public", + "table": "device_to_location", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "device_to_location_device_id_device_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "device_to_location_location_id_location_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "measurement", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "timestamp (3) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "sensor_id", + "time" + ], + "nullsNotDistinct": false, + "name": "measurement_sensor_id_time_unique", + "schema": "public", + "table": "measurement", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "measurement_location_id_location_id_fk", + "schema": "public", + "table": "measurement", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "password", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "password_user_id_user_id_fk", + "schema": "public", + "table": "password", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "password_reset_request", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "password_reset_request", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "password_reset_request", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "password_reset_request", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "nullsNotDistinct": false, + "name": "password_reset_request_user_id_unique", + "schema": "public", + "table": "password_reset_request", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "password_reset_request_user_id_user_id_fk", + "schema": "public", + "table": "password_reset_request", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_pkey", + "schema": "public", + "table": "profile", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "username", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "username" + ], + "nullsNotDistinct": false, + "name": "profile_username_unique", + "schema": "public", + "table": "profile", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_user_id_user_id_fk", + "schema": "public", + "table": "profile", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile_image", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_image_pkey", + "schema": "public", + "table": "profile_image", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "alt_text", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content_type", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "blob", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "profile_id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "profile_id" + ], + "schemaTo": "public", + "tableTo": "profile", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_image_profile_id_profile_id_fk", + "schema": "public", + "table": "profile_image", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "sensor", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "sensor_pkey", + "schema": "public", + "table": "sensor", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "icon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_phenomenon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastMeasurement", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "data", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "sensor_device_id_device_id_fk", + "schema": "public", + "table": "sensor", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "user", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "user_pkey", + "schema": "public", + "table": "user", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unconfirmed_email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'user'", + "generated": null, + "identity": null, + "name": "role", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'en_US'", + "generated": null, + "identity": null, + "name": "language", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "email_is_confirmed", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email_confirmation_token", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "email" + ], + "nullsNotDistinct": false, + "name": "user_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "unconfirmed_email" + ], + "nullsNotDistinct": false, + "name": "user_unconfirmed_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "isRlsEnabled": false, + "name": "location", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "location_pkey", + "schema": "public", + "table": "location", + "entityType": "pks" + }, + { + "type": "bigserial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "type": "geometry(point)", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "location" + ], + "nullsNotDistinct": false, + "name": "location_location_unique", + "schema": "public", + "table": "location", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "location", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "gist", + "concurrently": false, + "name": "location_index", + "schema": "public", + "table": "location", + "entityType": "indexes" + }, + { + "isRlsEnabled": false, + "name": "log_entry", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "log_entry_pkey", + "schema": "public", + "table": "log_entry", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "refresh_token", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "refresh_token_user_id_user_id_fk", + "schema": "public", + "table": "refresh_token", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "token_revocation", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "claim", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "claim_pkey", + "schema": "public", + "table": "claim", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "box_id", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "nameExplicit": true, + "columns": [ + "box_id" + ], + "nullsNotDistinct": false, + "name": "unique_box_id", + "schema": "public", + "table": "claim", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "expires_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "claim_expires_at_idx", + "schema": "public", + "table": "claim", + "entityType": "indexes" + }, + { + "nameExplicit": false, + "columns": [ + "box_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "claim_box_id_device_id_fk", + "schema": "public", + "table": "claim", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "integration", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "integration_pkey", + "schema": "public", + "table": "integration", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "slug", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "service_url", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "service_key", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "icon", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "order", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "slug" + ], + "nullsNotDistinct": false, + "name": "integration_slug_unique", + "schema": "public", + "table": "integration", + "entityType": "uniques" + }, + { + "values": [ + "indoor", + "outdoor", + "mobile", + "unknown" + ], + "name": "exposure", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "homeV2Lora", + "homeV2Ethernet", + "homeV2Wifi", + "homeEthernet", + "homeWifi", + "homeEthernetFeinstaub", + "homeWifiFeinstaub", + "luftdaten_sds011", + "luftdaten_sds011_dht11", + "luftdaten_sds011_dht22", + "luftdaten_sds011_bmp180", + "luftdaten_sds011_bme280", + "hackair_home_v2", + "senseBox:Edu", + "luftdaten.info", + "custom" + ], + "name": "model", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "active", + "inactive", + "old" + ], + "name": "status", + "schema": "public", + "entityType": "enums" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/app/db/drizzle/0033_caag-retention-policies.sql b/app/db/drizzle/20260225085431_caag-retention-policies/migration.sql similarity index 100% rename from app/db/drizzle/0033_caag-retention-policies.sql rename to app/db/drizzle/20260225085431_caag-retention-policies/migration.sql diff --git a/app/db/drizzle/20260225085431_caag-retention-policies/snapshot.json b/app/db/drizzle/20260225085431_caag-retention-policies/snapshot.json new file mode 100644 index 000000000..e998ba802 --- /dev/null +++ b/app/db/drizzle/20260225085431_caag-retention-policies/snapshot.json @@ -0,0 +1,1796 @@ +{ + "id": "2b328f08-9cdd-4a4f-a611-cd519981dd08", + "prevIds": [ + "d10e9d1c-dc82-4f0a-b93c-8810a746fe55" + ], + "version": "8", + "dialect": "postgres", + "ddl": [ + { + "isRlsEnabled": false, + "name": "device", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "device_pkey", + "schema": "public", + "table": "device", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "image", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "website", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 1, + "default": "ARRAY[]", + "generated": null, + "identity": null, + "name": "tags", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "link", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "use_auth", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "apiKey", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "exposure", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "exposure", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "model", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'custom'", + "generated": null, + "identity": null, + "name": "model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "date", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "latitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "longitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "device_to_location", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "columns": [ + "device_id", + "location_id", + "time" + ], + "nameExplicit": false, + "name": "device_to_location_device_id_location_id_time_pk", + "schema": "public", + "table": "device_to_location", + "entityType": "pks" + }, + { + "nameExplicit": false, + "columns": [ + "device_id", + "location_id", + "time" + ], + "nullsNotDistinct": false, + "name": "device_to_location_device_id_location_id_time_unique", + "schema": "public", + "table": "device_to_location", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "device_to_location_device_id_device_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "device_to_location_location_id_location_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "measurement", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "timestamp (3) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "sensor_id", + "time" + ], + "nullsNotDistinct": false, + "name": "measurement_sensor_id_time_unique", + "schema": "public", + "table": "measurement", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "measurement_location_id_location_id_fk", + "schema": "public", + "table": "measurement", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "password", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "password_user_id_user_id_fk", + "schema": "public", + "table": "password", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "password_reset_request", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "password_reset_request", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "password_reset_request", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "password_reset_request", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "nullsNotDistinct": false, + "name": "password_reset_request_user_id_unique", + "schema": "public", + "table": "password_reset_request", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "password_reset_request_user_id_user_id_fk", + "schema": "public", + "table": "password_reset_request", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_pkey", + "schema": "public", + "table": "profile", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "username", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "username" + ], + "nullsNotDistinct": false, + "name": "profile_username_unique", + "schema": "public", + "table": "profile", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_user_id_user_id_fk", + "schema": "public", + "table": "profile", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile_image", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_image_pkey", + "schema": "public", + "table": "profile_image", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "alt_text", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content_type", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "blob", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "profile_id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "profile_id" + ], + "schemaTo": "public", + "tableTo": "profile", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_image_profile_id_profile_id_fk", + "schema": "public", + "table": "profile_image", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "sensor", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "sensor_pkey", + "schema": "public", + "table": "sensor", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "icon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_phenomenon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastMeasurement", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "data", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "sensor_device_id_device_id_fk", + "schema": "public", + "table": "sensor", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "user", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "user_pkey", + "schema": "public", + "table": "user", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unconfirmed_email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'user'", + "generated": null, + "identity": null, + "name": "role", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'en_US'", + "generated": null, + "identity": null, + "name": "language", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "email_is_confirmed", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email_confirmation_token", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "email" + ], + "nullsNotDistinct": false, + "name": "user_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "unconfirmed_email" + ], + "nullsNotDistinct": false, + "name": "user_unconfirmed_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "isRlsEnabled": false, + "name": "location", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "location_pkey", + "schema": "public", + "table": "location", + "entityType": "pks" + }, + { + "type": "bigserial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "type": "geometry(point)", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "location" + ], + "nullsNotDistinct": false, + "name": "location_location_unique", + "schema": "public", + "table": "location", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "location", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "gist", + "concurrently": false, + "name": "location_index", + "schema": "public", + "table": "location", + "entityType": "indexes" + }, + { + "isRlsEnabled": false, + "name": "log_entry", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "log_entry_pkey", + "schema": "public", + "table": "log_entry", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "refresh_token", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "refresh_token_user_id_user_id_fk", + "schema": "public", + "table": "refresh_token", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "token_revocation", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "claim", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "claim_pkey", + "schema": "public", + "table": "claim", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "box_id", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "nameExplicit": true, + "columns": [ + "box_id" + ], + "nullsNotDistinct": false, + "name": "unique_box_id", + "schema": "public", + "table": "claim", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "expires_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "claim_expires_at_idx", + "schema": "public", + "table": "claim", + "entityType": "indexes" + }, + { + "nameExplicit": false, + "columns": [ + "box_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "claim_box_id_device_id_fk", + "schema": "public", + "table": "claim", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "integration", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "integration_pkey", + "schema": "public", + "table": "integration", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "slug", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "service_url", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "service_key", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "icon", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "order", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "slug" + ], + "nullsNotDistinct": false, + "name": "integration_slug_unique", + "schema": "public", + "table": "integration", + "entityType": "uniques" + }, + { + "values": [ + "indoor", + "outdoor", + "mobile", + "unknown" + ], + "name": "exposure", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "homeV2Lora", + "homeV2Ethernet", + "homeV2Wifi", + "homeEthernet", + "homeWifi", + "homeEthernetFeinstaub", + "homeWifiFeinstaub", + "luftdaten_sds011", + "luftdaten_sds011_dht11", + "luftdaten_sds011_dht22", + "luftdaten_sds011_bmp180", + "luftdaten_sds011_bme280", + "hackair_home_v2", + "senseBox:Edu", + "luftdaten.info", + "custom" + ], + "name": "model", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "active", + "inactive", + "old" + ], + "name": "status", + "schema": "public", + "entityType": "enums" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/app/db/drizzle/0034_moaning_ironclad.sql b/app/db/drizzle/20260313133711_moaning_ironclad/migration.sql similarity index 100% rename from app/db/drizzle/0034_moaning_ironclad.sql rename to app/db/drizzle/20260313133711_moaning_ironclad/migration.sql diff --git a/app/db/drizzle/20260313133711_moaning_ironclad/snapshot.json b/app/db/drizzle/20260313133711_moaning_ironclad/snapshot.json new file mode 100644 index 000000000..b27ada9e8 --- /dev/null +++ b/app/db/drizzle/20260313133711_moaning_ironclad/snapshot.json @@ -0,0 +1,1809 @@ +{ + "id": "1a28ba10-b068-44e1-a093-c9b3b4374ca3", + "prevIds": [ + "2df45cfc-982c-4c7c-b2e7-6fe47039d121" + ], + "version": "8", + "dialect": "postgres", + "ddl": [ + { + "isRlsEnabled": false, + "name": "device", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "device_pkey", + "schema": "public", + "table": "device", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "image", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "website", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 1, + "default": "ARRAY[]", + "generated": null, + "identity": null, + "name": "tags", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "link", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "use_auth", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "apiKey", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "exposure", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "exposure", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "model", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'custom'", + "generated": null, + "identity": null, + "name": "model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "orphaned_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "date", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "latitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "longitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "device_to_location", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "columns": [ + "device_id", + "location_id", + "time" + ], + "nameExplicit": false, + "name": "device_to_location_device_id_location_id_time_pk", + "schema": "public", + "table": "device_to_location", + "entityType": "pks" + }, + { + "nameExplicit": false, + "columns": [ + "device_id", + "location_id", + "time" + ], + "nullsNotDistinct": false, + "name": "device_to_location_device_id_location_id_time_unique", + "schema": "public", + "table": "device_to_location", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "device_to_location_device_id_device_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "device_to_location_location_id_location_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "measurement", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "timestamp (3) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "sensor_id", + "time" + ], + "nullsNotDistinct": false, + "name": "measurement_sensor_id_time_unique", + "schema": "public", + "table": "measurement", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "measurement_location_id_location_id_fk", + "schema": "public", + "table": "measurement", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "password", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "password_user_id_user_id_fk", + "schema": "public", + "table": "password", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "password_reset_request", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "password_reset_request", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "password_reset_request", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "password_reset_request", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "nullsNotDistinct": false, + "name": "password_reset_request_user_id_unique", + "schema": "public", + "table": "password_reset_request", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "password_reset_request_user_id_user_id_fk", + "schema": "public", + "table": "password_reset_request", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_pkey", + "schema": "public", + "table": "profile", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "username", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "username" + ], + "nullsNotDistinct": false, + "name": "profile_username_unique", + "schema": "public", + "table": "profile", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_user_id_user_id_fk", + "schema": "public", + "table": "profile", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile_image", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_image_pkey", + "schema": "public", + "table": "profile_image", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "alt_text", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content_type", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "blob", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "profile_id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "profile_id" + ], + "schemaTo": "public", + "tableTo": "profile", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_image_profile_id_profile_id_fk", + "schema": "public", + "table": "profile_image", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "sensor", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "sensor_pkey", + "schema": "public", + "table": "sensor", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "icon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_phenomenon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastMeasurement", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "data", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "sensor_device_id_device_id_fk", + "schema": "public", + "table": "sensor", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "user", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "user_pkey", + "schema": "public", + "table": "user", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unconfirmed_email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'user'", + "generated": null, + "identity": null, + "name": "role", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'en_US'", + "generated": null, + "identity": null, + "name": "language", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "email_is_confirmed", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email_confirmation_token", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "email" + ], + "nullsNotDistinct": false, + "name": "user_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "unconfirmed_email" + ], + "nullsNotDistinct": false, + "name": "user_unconfirmed_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "isRlsEnabled": false, + "name": "location", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "location_pkey", + "schema": "public", + "table": "location", + "entityType": "pks" + }, + { + "type": "bigserial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "type": "geometry(point)", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "location" + ], + "nullsNotDistinct": false, + "name": "location_location_unique", + "schema": "public", + "table": "location", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "location", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "gist", + "concurrently": false, + "name": "location_index", + "schema": "public", + "table": "location", + "entityType": "indexes" + }, + { + "isRlsEnabled": false, + "name": "log_entry", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "log_entry_pkey", + "schema": "public", + "table": "log_entry", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "refresh_token", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "refresh_token_user_id_user_id_fk", + "schema": "public", + "table": "refresh_token", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "token_revocation", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "claim", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "claim_pkey", + "schema": "public", + "table": "claim", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "box_id", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "nameExplicit": true, + "columns": [ + "box_id" + ], + "nullsNotDistinct": false, + "name": "unique_box_id", + "schema": "public", + "table": "claim", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "expires_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "claim_expires_at_idx", + "schema": "public", + "table": "claim", + "entityType": "indexes" + }, + { + "nameExplicit": false, + "columns": [ + "box_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "claim_box_id_device_id_fk", + "schema": "public", + "table": "claim", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "integration", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "integration_pkey", + "schema": "public", + "table": "integration", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "slug", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "service_url", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "service_key", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "icon", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "order", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "slug" + ], + "nullsNotDistinct": false, + "name": "integration_slug_unique", + "schema": "public", + "table": "integration", + "entityType": "uniques" + }, + { + "values": [ + "indoor", + "outdoor", + "mobile", + "unknown" + ], + "name": "exposure", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "homeV2Lora", + "homeV2Ethernet", + "homeV2Wifi", + "homeEthernet", + "homeWifi", + "homeEthernetFeinstaub", + "homeWifiFeinstaub", + "luftdaten_sds011", + "luftdaten_sds011_dht11", + "luftdaten_sds011_dht22", + "luftdaten_sds011_bmp180", + "luftdaten_sds011_bme280", + "hackair_home_v2", + "senseBox:Edu", + "luftdaten.info", + "custom" + ], + "name": "model", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "active", + "inactive", + "old" + ], + "name": "status", + "schema": "public", + "entityType": "enums" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/app/db/drizzle/0035_known_wiccan.sql b/app/db/drizzle/20260317103034_known_wiccan/migration.sql similarity index 100% rename from app/db/drizzle/0035_known_wiccan.sql rename to app/db/drizzle/20260317103034_known_wiccan/migration.sql diff --git a/app/db/drizzle/20260317103034_known_wiccan/snapshot.json b/app/db/drizzle/20260317103034_known_wiccan/snapshot.json new file mode 100644 index 000000000..6556cb058 --- /dev/null +++ b/app/db/drizzle/20260317103034_known_wiccan/snapshot.json @@ -0,0 +1,1820 @@ +{ + "id": "4cd6d47a-974c-4190-8e2b-29113d56eb56", + "prevIds": [ + "1a28ba10-b068-44e1-a093-c9b3b4374ca3" + ], + "version": "8", + "dialect": "postgres", + "ddl": [ + { + "isRlsEnabled": false, + "name": "device", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "device_pkey", + "schema": "public", + "table": "device", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "image", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "website", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 1, + "default": "ARRAY[]", + "generated": null, + "identity": null, + "name": "tags", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "link", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "use_auth", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "apiKey", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "exposure", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "exposure", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "model", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'custom'", + "generated": null, + "identity": null, + "name": "model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "orphaned_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "date", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "latitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "longitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "device_to_location", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "columns": [ + "device_id", + "location_id", + "time" + ], + "nameExplicit": false, + "name": "device_to_location_device_id_location_id_time_pk", + "schema": "public", + "table": "device_to_location", + "entityType": "pks" + }, + { + "nameExplicit": false, + "columns": [ + "device_id", + "location_id", + "time" + ], + "nullsNotDistinct": false, + "name": "device_to_location_device_id_location_id_time_unique", + "schema": "public", + "table": "device_to_location", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "device_to_location_device_id_device_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "device_to_location_location_id_location_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "measurement", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "timestamp (3) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "sensor_id", + "time" + ], + "nullsNotDistinct": false, + "name": "measurement_sensor_id_time_unique", + "schema": "public", + "table": "measurement", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "measurement_location_id_location_id_fk", + "schema": "public", + "table": "measurement", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "password", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "password_user_id_user_id_fk", + "schema": "public", + "table": "password", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "password_reset_request", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "password_reset_request", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "password_reset_request", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "password_reset_request", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "nullsNotDistinct": false, + "name": "password_reset_request_user_id_unique", + "schema": "public", + "table": "password_reset_request", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "password_reset_request_user_id_user_id_fk", + "schema": "public", + "table": "password_reset_request", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_pkey", + "schema": "public", + "table": "profile", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "display_name", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "nullsNotDistinct": false, + "name": "profile_user_id_unique", + "schema": "public", + "table": "profile", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_user_id_user_id_fk", + "schema": "public", + "table": "profile", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile_image", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_image_pkey", + "schema": "public", + "table": "profile_image", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "alt_text", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content_type", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "blob", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "profile_id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "profile_id" + ], + "schemaTo": "public", + "tableTo": "profile", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_image_profile_id_profile_id_fk", + "schema": "public", + "table": "profile_image", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "sensor", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "sensor_pkey", + "schema": "public", + "table": "sensor", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "icon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_phenomenon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastMeasurement", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "data", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "sensor_device_id_device_id_fk", + "schema": "public", + "table": "sensor", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "user", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "user_pkey", + "schema": "public", + "table": "user", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unconfirmed_email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'user'", + "generated": null, + "identity": null, + "name": "role", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'en_US'", + "generated": null, + "identity": null, + "name": "language", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "email_is_confirmed", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email_confirmation_token", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "name" + ], + "nullsNotDistinct": false, + "name": "user_name_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "email" + ], + "nullsNotDistinct": false, + "name": "user_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "unconfirmed_email" + ], + "nullsNotDistinct": false, + "name": "user_unconfirmed_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "isRlsEnabled": false, + "name": "location", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "location_pkey", + "schema": "public", + "table": "location", + "entityType": "pks" + }, + { + "type": "bigserial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "type": "geometry(point)", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "location" + ], + "nullsNotDistinct": false, + "name": "location_location_unique", + "schema": "public", + "table": "location", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "location", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "gist", + "concurrently": false, + "name": "location_index", + "schema": "public", + "table": "location", + "entityType": "indexes" + }, + { + "isRlsEnabled": false, + "name": "log_entry", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "log_entry_pkey", + "schema": "public", + "table": "log_entry", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "refresh_token", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "refresh_token_user_id_user_id_fk", + "schema": "public", + "table": "refresh_token", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "token_revocation", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "claim", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "claim_pkey", + "schema": "public", + "table": "claim", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "box_id", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "nameExplicit": true, + "columns": [ + "box_id" + ], + "nullsNotDistinct": false, + "name": "unique_box_id", + "schema": "public", + "table": "claim", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "expires_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "claim_expires_at_idx", + "schema": "public", + "table": "claim", + "entityType": "indexes" + }, + { + "nameExplicit": false, + "columns": [ + "box_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "claim_box_id_device_id_fk", + "schema": "public", + "table": "claim", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "integration", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "integration_pkey", + "schema": "public", + "table": "integration", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "slug", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "service_url", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "service_key", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "icon", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "order", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "slug" + ], + "nullsNotDistinct": false, + "name": "integration_slug_unique", + "schema": "public", + "table": "integration", + "entityType": "uniques" + }, + { + "values": [ + "indoor", + "outdoor", + "mobile", + "unknown" + ], + "name": "exposure", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "homeV2Lora", + "homeV2Ethernet", + "homeV2Wifi", + "homeEthernet", + "homeWifi", + "homeEthernetFeinstaub", + "homeWifiFeinstaub", + "luftdaten_sds011", + "luftdaten_sds011_dht11", + "luftdaten_sds011_dht22", + "luftdaten_sds011_bmp180", + "luftdaten_sds011_bme280", + "hackair_home_v2", + "senseBox:Edu", + "luftdaten.info", + "custom" + ], + "name": "model", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "active", + "inactive", + "old" + ], + "name": "status", + "schema": "public", + "entityType": "enums" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/app/db/drizzle/0036_even_power_man.sql b/app/db/drizzle/20260318110532_even_power_man/migration.sql similarity index 100% rename from app/db/drizzle/0036_even_power_man.sql rename to app/db/drizzle/20260318110532_even_power_man/migration.sql diff --git a/app/db/drizzle/20260318110532_even_power_man/snapshot.json b/app/db/drizzle/20260318110532_even_power_man/snapshot.json new file mode 100644 index 000000000..fbe6516ba --- /dev/null +++ b/app/db/drizzle/20260318110532_even_power_man/snapshot.json @@ -0,0 +1,1833 @@ +{ + "id": "cf6968f1-c554-4f95-a276-0c25511c7421", + "prevIds": [ + "4cd6d47a-974c-4190-8e2b-29113d56eb56" + ], + "version": "8", + "dialect": "postgres", + "ddl": [ + { + "isRlsEnabled": false, + "name": "device", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "device_pkey", + "schema": "public", + "table": "device", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "image", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "website", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 1, + "default": "ARRAY[]", + "generated": null, + "identity": null, + "name": "tags", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "link", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "use_auth", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "apiKey", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "exposure", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "exposure", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "model", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'custom'", + "generated": null, + "identity": null, + "name": "model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "orphaned_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "date", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "latitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "longitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "device_to_location", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "columns": [ + "device_id", + "location_id", + "time" + ], + "nameExplicit": false, + "name": "device_to_location_device_id_location_id_time_pk", + "schema": "public", + "table": "device_to_location", + "entityType": "pks" + }, + { + "nameExplicit": false, + "columns": [ + "device_id", + "location_id", + "time" + ], + "nullsNotDistinct": false, + "name": "device_to_location_device_id_location_id_time_unique", + "schema": "public", + "table": "device_to_location", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "device_to_location_device_id_device_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "device_to_location_location_id_location_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "measurement", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "timestamp (3) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "sensor_id", + "time" + ], + "nullsNotDistinct": false, + "name": "measurement_sensor_id_time_unique", + "schema": "public", + "table": "measurement", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "measurement_location_id_location_id_fk", + "schema": "public", + "table": "measurement", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "password", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "password_user_id_user_id_fk", + "schema": "public", + "table": "password", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "password_reset_request", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "password_reset_request", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "password_reset_request", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "password_reset_request", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "nullsNotDistinct": false, + "name": "password_reset_request_user_id_unique", + "schema": "public", + "table": "password_reset_request", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "password_reset_request_user_id_user_id_fk", + "schema": "public", + "table": "password_reset_request", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_pkey", + "schema": "public", + "table": "profile", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "display_name", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "nullsNotDistinct": false, + "name": "profile_user_id_unique", + "schema": "public", + "table": "profile", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_user_id_user_id_fk", + "schema": "public", + "table": "profile", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile_image", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_image_pkey", + "schema": "public", + "table": "profile_image", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "alt_text", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content_type", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "blob", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "profile_id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "profile_id" + ], + "schemaTo": "public", + "tableTo": "profile", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_image_profile_id_profile_id_fk", + "schema": "public", + "table": "profile_image", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "sensor", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "sensor_pkey", + "schema": "public", + "table": "sensor", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "icon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_phenomenon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastMeasurement", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "data", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "order", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "sensor_device_id_device_id_fk", + "schema": "public", + "table": "sensor", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "user", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "user_pkey", + "schema": "public", + "table": "user", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unconfirmed_email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'user'", + "generated": null, + "identity": null, + "name": "role", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'en_US'", + "generated": null, + "identity": null, + "name": "language", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "email_is_confirmed", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email_confirmation_token", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "name" + ], + "nullsNotDistinct": false, + "name": "user_name_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "email" + ], + "nullsNotDistinct": false, + "name": "user_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "unconfirmed_email" + ], + "nullsNotDistinct": false, + "name": "user_unconfirmed_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "isRlsEnabled": false, + "name": "location", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "location_pkey", + "schema": "public", + "table": "location", + "entityType": "pks" + }, + { + "type": "bigserial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "type": "geometry(point)", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "location" + ], + "nullsNotDistinct": false, + "name": "location_location_unique", + "schema": "public", + "table": "location", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "location", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "gist", + "concurrently": false, + "name": "location_index", + "schema": "public", + "table": "location", + "entityType": "indexes" + }, + { + "isRlsEnabled": false, + "name": "log_entry", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "log_entry_pkey", + "schema": "public", + "table": "log_entry", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "refresh_token", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "refresh_token_user_id_user_id_fk", + "schema": "public", + "table": "refresh_token", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "token_revocation", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "claim", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "claim_pkey", + "schema": "public", + "table": "claim", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "box_id", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "nameExplicit": true, + "columns": [ + "box_id" + ], + "nullsNotDistinct": false, + "name": "unique_box_id", + "schema": "public", + "table": "claim", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "expires_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "claim_expires_at_idx", + "schema": "public", + "table": "claim", + "entityType": "indexes" + }, + { + "nameExplicit": false, + "columns": [ + "box_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "claim_box_id_device_id_fk", + "schema": "public", + "table": "claim", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "integration", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "integration_pkey", + "schema": "public", + "table": "integration", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "slug", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "service_url", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "service_key", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "icon", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "order", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "slug" + ], + "nullsNotDistinct": false, + "name": "integration_slug_unique", + "schema": "public", + "table": "integration", + "entityType": "uniques" + }, + { + "values": [ + "indoor", + "outdoor", + "mobile", + "unknown" + ], + "name": "exposure", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "homeV2Lora", + "homeV2Ethernet", + "homeV2Wifi", + "homeEthernet", + "homeWifi", + "homeEthernetFeinstaub", + "homeWifiFeinstaub", + "luftdaten_sds011", + "luftdaten_sds011_dht11", + "luftdaten_sds011_dht22", + "luftdaten_sds011_bmp180", + "luftdaten_sds011_bme280", + "hackair_home_v2", + "senseBox:Edu", + "luftdaten.info", + "custom" + ], + "name": "model", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "active", + "inactive", + "old" + ], + "name": "status", + "schema": "public", + "entityType": "enums" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/app/db/drizzle/0037_amused_bullseye.sql b/app/db/drizzle/20260323112954_amused_bullseye/migration.sql similarity index 100% rename from app/db/drizzle/0037_amused_bullseye.sql rename to app/db/drizzle/20260323112954_amused_bullseye/migration.sql diff --git a/app/db/drizzle/20260323112954_amused_bullseye/snapshot.json b/app/db/drizzle/20260323112954_amused_bullseye/snapshot.json new file mode 100644 index 000000000..f775b107a --- /dev/null +++ b/app/db/drizzle/20260323112954_amused_bullseye/snapshot.json @@ -0,0 +1,2272 @@ +{ + "id": "513e801d-dcfc-4de3-9ad9-a500787860cc", + "prevIds": [ + "cf6968f1-c554-4f95-a276-0c25511c7421" + ], + "version": "8", + "dialect": "postgres", + "ddl": [ + { + "isRlsEnabled": false, + "name": "device", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "device_pkey", + "schema": "public", + "table": "device", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "image", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "website", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 1, + "default": "ARRAY[]", + "generated": null, + "identity": null, + "name": "tags", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "link", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "use_auth", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "apiKey", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "exposure", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "exposure", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "model", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'custom'", + "generated": null, + "identity": null, + "name": "model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "orphaned_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "date", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "latitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "longitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "device_user_id_user_id_fk", + "schema": "public", + "table": "device", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "device_to_location", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "columns": [ + "device_id", + "location_id", + "time" + ], + "nameExplicit": false, + "name": "device_to_location_device_id_location_id_time_pk", + "schema": "public", + "table": "device_to_location", + "entityType": "pks" + }, + { + "nameExplicit": false, + "columns": [ + "device_id", + "location_id", + "time" + ], + "nullsNotDistinct": false, + "name": "device_to_location_device_id_location_id_time_unique", + "schema": "public", + "table": "device_to_location", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "device_to_location_device_id_device_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "device_to_location_location_id_location_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "measurement", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "timestamp (3) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "sensor_id", + "time" + ], + "nullsNotDistinct": false, + "name": "measurement_sensor_id_time_unique", + "schema": "public", + "table": "measurement", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "measurement_location_id_location_id_fk", + "schema": "public", + "table": "measurement", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "password", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "columns": [ + "user_id" + ], + "nameExplicit": false, + "name": "password_pkey", + "schema": "public", + "table": "password", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "password_user_id_user_id_fk", + "schema": "public", + "table": "password", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_pkey", + "schema": "public", + "table": "profile", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "display_name", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "nullsNotDistinct": false, + "name": "profile_user_id_unique", + "schema": "public", + "table": "profile", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_user_id_user_id_fk", + "schema": "public", + "table": "profile", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile_image", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_image_pkey", + "schema": "public", + "table": "profile_image", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "alt_text", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content_type", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "blob", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "profile_id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "profile_id" + ], + "schemaTo": "public", + "tableTo": "profile", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_image_profile_id_profile_id_fk", + "schema": "public", + "table": "profile_image", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "sensor", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "sensor_pkey", + "schema": "public", + "table": "sensor", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "icon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_phenomenon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastMeasurement", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "data", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "order", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "sensor_device_id_device_id_fk", + "schema": "public", + "table": "sensor", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "user", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "user_pkey", + "schema": "public", + "table": "user", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unconfirmed_email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'user'", + "generated": null, + "identity": null, + "name": "role", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'en_US'", + "generated": null, + "identity": null, + "name": "language", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "email_is_confirmed", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "accepted_tos_version_id", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "accepted_tos_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "name" + ], + "nullsNotDistinct": false, + "name": "user_name_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "email" + ], + "nullsNotDistinct": false, + "name": "user_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "unconfirmed_email" + ], + "nullsNotDistinct": false, + "name": "user_unconfirmed_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "accepted_tos_version_id" + ], + "schemaTo": "public", + "tableTo": "tos_version", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "user_accepted_tos_version_id_tos_version_id_fk", + "schema": "public", + "table": "user", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "location", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "location_pkey", + "schema": "public", + "table": "location", + "entityType": "pks" + }, + { + "type": "bigserial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "type": "geometry(point)", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "location" + ], + "nullsNotDistinct": false, + "name": "location_location_unique", + "schema": "public", + "table": "location", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "location", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "gist", + "concurrently": false, + "name": "location_index", + "schema": "public", + "table": "location", + "entityType": "indexes" + }, + { + "isRlsEnabled": false, + "name": "log_entry", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "log_entry_pkey", + "schema": "public", + "table": "log_entry", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "refresh_token", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "refresh_token_user_id_user_id_fk", + "schema": "public", + "table": "refresh_token", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "token_revocation", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "claim", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "claim_pkey", + "schema": "public", + "table": "claim", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "box_id", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "nameExplicit": true, + "columns": [ + "box_id" + ], + "nullsNotDistinct": false, + "name": "unique_box_id", + "schema": "public", + "table": "claim", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "expires_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "claim_expires_at_idx", + "schema": "public", + "table": "claim", + "entityType": "indexes" + }, + { + "nameExplicit": false, + "columns": [ + "box_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "claim_box_id_device_id_fk", + "schema": "public", + "table": "claim", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "integration", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "integration_pkey", + "schema": "public", + "table": "integration", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "slug", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "service_url", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "service_key", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "icon", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "order", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "slug" + ], + "nullsNotDistinct": false, + "name": "integration_slug_unique", + "schema": "public", + "table": "integration", + "entityType": "uniques" + }, + { + "isRlsEnabled": false, + "name": "tos_user_state", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "tos_user_state", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "tos_version_id", + "schema": "public", + "table": "tos_user_state", + "entityType": "columns" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "accepted_at", + "schema": "public", + "table": "tos_user_state", + "entityType": "columns" + }, + { + "columns": [ + "user_id", + "tos_version_id" + ], + "nameExplicit": false, + "name": "tos_user_state_user_id_tos_version_id_pk", + "schema": "public", + "table": "tos_user_state", + "entityType": "pks" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "user_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "tos_user_state_user_idx", + "schema": "public", + "table": "tos_user_state", + "entityType": "indexes" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "tos_user_state_user_id_user_id_fk", + "schema": "public", + "table": "tos_user_state", + "entityType": "fks" + }, + { + "nameExplicit": false, + "columns": [ + "tos_version_id" + ], + "schemaTo": "public", + "tableTo": "tos_version", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "tos_user_state_tos_version_id_tos_version_id_fk", + "schema": "public", + "table": "tos_user_state", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "tos_version", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "tos_version_pkey", + "schema": "public", + "table": "tos_version", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "version", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "body", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "effective_from", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "accept_by", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "version" + ], + "nullsNotDistinct": false, + "name": "tos_version_version_unique", + "schema": "public", + "table": "tos_version", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "effective_from", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "tos_version_effective_from_idx", + "schema": "public", + "table": "tos_version", + "entityType": "indexes" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "accept_by", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "tos_version_accept_by_idx", + "schema": "public", + "table": "tos_version", + "entityType": "indexes" + }, + { + "isRlsEnabled": false, + "name": "action_token", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "action_token_pkey", + "schema": "public", + "table": "action_token", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "action_token", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "action_token", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "purpose", + "schema": "public", + "table": "action_token", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token_hash", + "schema": "public", + "table": "action_token", + "entityType": "columns" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "action_token", + "entityType": "columns" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "consumed_at", + "schema": "public", + "table": "action_token", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "token_hash" + ], + "nullsNotDistinct": false, + "name": "action_token_token_hash_unique", + "schema": "public", + "table": "action_token", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "user_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "purpose", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "action_token_user_purpose_uq", + "schema": "public", + "table": "action_token", + "entityType": "indexes" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "expires_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "action_token_expires_at_idx", + "schema": "public", + "table": "action_token", + "entityType": "indexes" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "action_token_user_id_user_id_fk", + "schema": "public", + "table": "action_token", + "entityType": "fks" + }, + { + "values": [ + "indoor", + "outdoor", + "mobile", + "unknown" + ], + "name": "exposure", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "homeV2Lora", + "homeV2Ethernet", + "homeV2Wifi", + "homeEthernet", + "homeWifi", + "homeEthernetFeinstaub", + "homeWifiFeinstaub", + "luftdaten_sds011", + "luftdaten_sds011_dht11", + "luftdaten_sds011_dht22", + "luftdaten_sds011_bmp180", + "luftdaten_sds011_bme280", + "hackair_home_v2", + "senseBox:Edu", + "luftdaten.info", + "custom" + ], + "name": "model", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "active", + "inactive", + "old" + ], + "name": "status", + "schema": "public", + "entityType": "enums" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/app/db/drizzle/0038_peaceful_the_enforcers.sql b/app/db/drizzle/20260325073938_peaceful_the_enforcers/migration.sql similarity index 100% rename from app/db/drizzle/0038_peaceful_the_enforcers.sql rename to app/db/drizzle/20260325073938_peaceful_the_enforcers/migration.sql diff --git a/app/db/drizzle/20260325073938_peaceful_the_enforcers/snapshot.json b/app/db/drizzle/20260325073938_peaceful_the_enforcers/snapshot.json new file mode 100644 index 000000000..8cbab7b7e --- /dev/null +++ b/app/db/drizzle/20260325073938_peaceful_the_enforcers/snapshot.json @@ -0,0 +1,2259 @@ +{ + "id": "6ecbc69b-9a3a-49e1-8ad9-980c1d92a87f", + "prevIds": [ + "513e801d-dcfc-4de3-9ad9-a500787860cc" + ], + "version": "8", + "dialect": "postgres", + "ddl": [ + { + "isRlsEnabled": false, + "name": "device", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "device_pkey", + "schema": "public", + "table": "device", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "image", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "website", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 1, + "default": "ARRAY[]", + "generated": null, + "identity": null, + "name": "tags", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "link", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "use_auth", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "apiKey", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "exposure", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "exposure", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "model", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'custom'", + "generated": null, + "identity": null, + "name": "model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "orphaned_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "date", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "latitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "longitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "device_user_id_user_id_fk", + "schema": "public", + "table": "device", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "device_to_location", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "columns": [ + "device_id", + "location_id", + "time" + ], + "nameExplicit": false, + "name": "device_to_location_device_id_location_id_time_pk", + "schema": "public", + "table": "device_to_location", + "entityType": "pks" + }, + { + "nameExplicit": false, + "columns": [ + "device_id", + "location_id", + "time" + ], + "nullsNotDistinct": false, + "name": "device_to_location_device_id_location_id_time_unique", + "schema": "public", + "table": "device_to_location", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "device_to_location_device_id_device_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "device_to_location_location_id_location_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "measurement", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "timestamp (3) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "sensor_id", + "time" + ], + "nullsNotDistinct": false, + "name": "measurement_sensor_id_time_unique", + "schema": "public", + "table": "measurement", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "measurement_location_id_location_id_fk", + "schema": "public", + "table": "measurement", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "password", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "columns": [ + "user_id" + ], + "nameExplicit": false, + "name": "password_pkey", + "schema": "public", + "table": "password", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "password_user_id_user_id_fk", + "schema": "public", + "table": "password", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_pkey", + "schema": "public", + "table": "profile", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "display_name", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "nullsNotDistinct": false, + "name": "profile_user_id_unique", + "schema": "public", + "table": "profile", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_user_id_user_id_fk", + "schema": "public", + "table": "profile", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile_image", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_image_pkey", + "schema": "public", + "table": "profile_image", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "alt_text", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content_type", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "blob", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "profile_id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "profile_id" + ], + "schemaTo": "public", + "tableTo": "profile", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_image_profile_id_profile_id_fk", + "schema": "public", + "table": "profile_image", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "sensor", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "sensor_pkey", + "schema": "public", + "table": "sensor", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "icon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_phenomenon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastMeasurement", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "data", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "order", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "sensor_device_id_device_id_fk", + "schema": "public", + "table": "sensor", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "user", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "user_pkey", + "schema": "public", + "table": "user", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unconfirmed_email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'user'", + "generated": null, + "identity": null, + "name": "role", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'en_US'", + "generated": null, + "identity": null, + "name": "language", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "email_is_confirmed", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "accepted_tos_version_id", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "accepted_tos_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "name" + ], + "nullsNotDistinct": false, + "name": "user_name_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "email" + ], + "nullsNotDistinct": false, + "name": "user_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "unconfirmed_email" + ], + "nullsNotDistinct": false, + "name": "user_unconfirmed_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "accepted_tos_version_id" + ], + "schemaTo": "public", + "tableTo": "tos_version", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "user_accepted_tos_version_id_tos_version_id_fk", + "schema": "public", + "table": "user", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "location", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "location_pkey", + "schema": "public", + "table": "location", + "entityType": "pks" + }, + { + "type": "bigserial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "type": "geometry(point)", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "location" + ], + "nullsNotDistinct": false, + "name": "location_location_unique", + "schema": "public", + "table": "location", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "location", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "gist", + "concurrently": false, + "name": "location_index", + "schema": "public", + "table": "location", + "entityType": "indexes" + }, + { + "isRlsEnabled": false, + "name": "log_entry", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "log_entry_pkey", + "schema": "public", + "table": "log_entry", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "refresh_token", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "refresh_token_user_id_user_id_fk", + "schema": "public", + "table": "refresh_token", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "token_revocation", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "claim", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "claim_pkey", + "schema": "public", + "table": "claim", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "box_id", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "nameExplicit": true, + "columns": [ + "box_id" + ], + "nullsNotDistinct": false, + "name": "unique_box_id", + "schema": "public", + "table": "claim", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "expires_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "claim_expires_at_idx", + "schema": "public", + "table": "claim", + "entityType": "indexes" + }, + { + "nameExplicit": false, + "columns": [ + "box_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "claim_box_id_device_id_fk", + "schema": "public", + "table": "claim", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "integration", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "integration_pkey", + "schema": "public", + "table": "integration", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "slug", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "service_url", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "service_key", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "icon", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "order", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "slug" + ], + "nullsNotDistinct": false, + "name": "integration_slug_unique", + "schema": "public", + "table": "integration", + "entityType": "uniques" + }, + { + "isRlsEnabled": false, + "name": "tos_user_state", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "tos_user_state", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "tos_version_id", + "schema": "public", + "table": "tos_user_state", + "entityType": "columns" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "accepted_at", + "schema": "public", + "table": "tos_user_state", + "entityType": "columns" + }, + { + "columns": [ + "user_id", + "tos_version_id" + ], + "nameExplicit": false, + "name": "tos_user_state_user_id_tos_version_id_pk", + "schema": "public", + "table": "tos_user_state", + "entityType": "pks" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "user_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "tos_user_state_user_idx", + "schema": "public", + "table": "tos_user_state", + "entityType": "indexes" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "tos_user_state_user_id_user_id_fk", + "schema": "public", + "table": "tos_user_state", + "entityType": "fks" + }, + { + "nameExplicit": false, + "columns": [ + "tos_version_id" + ], + "schemaTo": "public", + "tableTo": "tos_version", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "tos_user_state_tos_version_id_tos_version_id_fk", + "schema": "public", + "table": "tos_user_state", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "tos_version", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "tos_version_pkey", + "schema": "public", + "table": "tos_version", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "version", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "body", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "effective_from", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "accept_by", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "version" + ], + "nullsNotDistinct": false, + "name": "tos_version_version_unique", + "schema": "public", + "table": "tos_version", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "effective_from", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "tos_version_effective_from_idx", + "schema": "public", + "table": "tos_version", + "entityType": "indexes" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "accept_by", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "tos_version_accept_by_idx", + "schema": "public", + "table": "tos_version", + "entityType": "indexes" + }, + { + "isRlsEnabled": false, + "name": "action_token", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "action_token_pkey", + "schema": "public", + "table": "action_token", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "action_token", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "action_token", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "purpose", + "schema": "public", + "table": "action_token", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token_hash", + "schema": "public", + "table": "action_token", + "entityType": "columns" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "action_token", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "token_hash" + ], + "nullsNotDistinct": false, + "name": "action_token_token_hash_unique", + "schema": "public", + "table": "action_token", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "user_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "purpose", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "action_token_user_purpose_uq", + "schema": "public", + "table": "action_token", + "entityType": "indexes" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "expires_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "action_token_expires_at_idx", + "schema": "public", + "table": "action_token", + "entityType": "indexes" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "action_token_user_id_user_id_fk", + "schema": "public", + "table": "action_token", + "entityType": "fks" + }, + { + "values": [ + "indoor", + "outdoor", + "mobile", + "unknown" + ], + "name": "exposure", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "homeV2Lora", + "homeV2Ethernet", + "homeV2Wifi", + "homeEthernet", + "homeWifi", + "homeEthernetFeinstaub", + "homeWifiFeinstaub", + "luftdaten_sds011", + "luftdaten_sds011_dht11", + "luftdaten_sds011_dht22", + "luftdaten_sds011_bmp180", + "luftdaten_sds011_bme280", + "hackair_home_v2", + "senseBox:Edu", + "luftdaten.info", + "custom" + ], + "name": "model", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "active", + "inactive", + "old" + ], + "name": "status", + "schema": "public", + "entityType": "enums" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/app/db/drizzle/0039_simple_wallow.sql b/app/db/drizzle/20260325074736_simple_wallow/migration.sql similarity index 100% rename from app/db/drizzle/0039_simple_wallow.sql rename to app/db/drizzle/20260325074736_simple_wallow/migration.sql diff --git a/app/db/drizzle/20260325074736_simple_wallow/snapshot.json b/app/db/drizzle/20260325074736_simple_wallow/snapshot.json new file mode 100644 index 000000000..d96905110 --- /dev/null +++ b/app/db/drizzle/20260325074736_simple_wallow/snapshot.json @@ -0,0 +1,2259 @@ +{ + "id": "b685080d-7e89-48b2-8e06-0f413d73f935", + "prevIds": [ + "6ecbc69b-9a3a-49e1-8ad9-980c1d92a87f" + ], + "version": "8", + "dialect": "postgres", + "ddl": [ + { + "isRlsEnabled": false, + "name": "device", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "device_pkey", + "schema": "public", + "table": "device", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "image", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "website", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 1, + "default": "ARRAY[]", + "generated": null, + "identity": null, + "name": "tags", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "link", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "use_auth", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "apiKey", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "exposure", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "exposure", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "model", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'custom'", + "generated": null, + "identity": null, + "name": "model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "orphaned_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "date", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "latitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "longitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "device_user_id_user_id_fk", + "schema": "public", + "table": "device", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "device_to_location", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "columns": [ + "device_id", + "location_id", + "time" + ], + "nameExplicit": false, + "name": "device_to_location_device_id_location_id_time_pk", + "schema": "public", + "table": "device_to_location", + "entityType": "pks" + }, + { + "nameExplicit": false, + "columns": [ + "device_id", + "location_id", + "time" + ], + "nullsNotDistinct": false, + "name": "device_to_location_device_id_location_id_time_unique", + "schema": "public", + "table": "device_to_location", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "device_to_location_device_id_device_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "device_to_location_location_id_location_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "measurement", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "timestamp (3) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "sensor_id", + "time" + ], + "nullsNotDistinct": false, + "name": "measurement_sensor_id_time_unique", + "schema": "public", + "table": "measurement", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "measurement_location_id_location_id_fk", + "schema": "public", + "table": "measurement", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "password", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "columns": [ + "user_id" + ], + "nameExplicit": false, + "name": "password_pkey", + "schema": "public", + "table": "password", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "password_user_id_user_id_fk", + "schema": "public", + "table": "password", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_pkey", + "schema": "public", + "table": "profile", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "display_name", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "nullsNotDistinct": false, + "name": "profile_user_id_unique", + "schema": "public", + "table": "profile", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_user_id_user_id_fk", + "schema": "public", + "table": "profile", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile_image", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_image_pkey", + "schema": "public", + "table": "profile_image", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "alt_text", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content_type", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "blob", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "profile_id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "profile_id" + ], + "schemaTo": "public", + "tableTo": "profile", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_image_profile_id_profile_id_fk", + "schema": "public", + "table": "profile_image", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "sensor", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "sensor_pkey", + "schema": "public", + "table": "sensor", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "icon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_phenomenon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastMeasurement", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "data", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "order", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "sensor_device_id_device_id_fk", + "schema": "public", + "table": "sensor", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "user", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "user_pkey", + "schema": "public", + "table": "user", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unconfirmed_email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'user'", + "generated": null, + "identity": null, + "name": "role", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'en_US'", + "generated": null, + "identity": null, + "name": "language", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "email_is_confirmed", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "accepted_tos_version_id", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "accepted_tos_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "name" + ], + "nullsNotDistinct": false, + "name": "user_name_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "email" + ], + "nullsNotDistinct": false, + "name": "user_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "unconfirmed_email" + ], + "nullsNotDistinct": false, + "name": "user_unconfirmed_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "accepted_tos_version_id" + ], + "schemaTo": "public", + "tableTo": "tos_version", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "user_accepted_tos_version_id_tos_version_id_fk", + "schema": "public", + "table": "user", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "location", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "location_pkey", + "schema": "public", + "table": "location", + "entityType": "pks" + }, + { + "type": "bigserial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "type": "geometry(point)", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "location" + ], + "nullsNotDistinct": false, + "name": "location_location_unique", + "schema": "public", + "table": "location", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "location", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "gist", + "concurrently": false, + "name": "location_index", + "schema": "public", + "table": "location", + "entityType": "indexes" + }, + { + "isRlsEnabled": false, + "name": "log_entry", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "log_entry_pkey", + "schema": "public", + "table": "log_entry", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "refresh_token", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "refresh_token_user_id_user_id_fk", + "schema": "public", + "table": "refresh_token", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "token_revocation", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "claim", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "claim_pkey", + "schema": "public", + "table": "claim", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "box_id", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "nameExplicit": true, + "columns": [ + "box_id" + ], + "nullsNotDistinct": false, + "name": "unique_box_id", + "schema": "public", + "table": "claim", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "expires_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "claim_expires_at_idx", + "schema": "public", + "table": "claim", + "entityType": "indexes" + }, + { + "nameExplicit": false, + "columns": [ + "box_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "claim_box_id_device_id_fk", + "schema": "public", + "table": "claim", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "integration", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "integration_pkey", + "schema": "public", + "table": "integration", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "slug", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "service_url", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "service_key", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "icon", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "order", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "slug" + ], + "nullsNotDistinct": false, + "name": "integration_slug_unique", + "schema": "public", + "table": "integration", + "entityType": "uniques" + }, + { + "isRlsEnabled": false, + "name": "tos_user_state", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "tos_user_state", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "tos_version_id", + "schema": "public", + "table": "tos_user_state", + "entityType": "columns" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "accepted_at", + "schema": "public", + "table": "tos_user_state", + "entityType": "columns" + }, + { + "columns": [ + "user_id", + "tos_version_id" + ], + "nameExplicit": false, + "name": "tos_user_state_user_id_tos_version_id_pk", + "schema": "public", + "table": "tos_user_state", + "entityType": "pks" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "user_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "tos_user_state_user_idx", + "schema": "public", + "table": "tos_user_state", + "entityType": "indexes" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "tos_user_state_user_id_user_id_fk", + "schema": "public", + "table": "tos_user_state", + "entityType": "fks" + }, + { + "nameExplicit": false, + "columns": [ + "tos_version_id" + ], + "schemaTo": "public", + "tableTo": "tos_version", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "tos_user_state_tos_version_id_tos_version_id_fk", + "schema": "public", + "table": "tos_user_state", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "tos_version", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "tos_version_pkey", + "schema": "public", + "table": "tos_version", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "version", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "body", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "effective_from", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "accept_by", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "version" + ], + "nullsNotDistinct": false, + "name": "tos_version_version_unique", + "schema": "public", + "table": "tos_version", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "effective_from", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "tos_version_effective_from_idx", + "schema": "public", + "table": "tos_version", + "entityType": "indexes" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "accept_by", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "tos_version_accept_by_idx", + "schema": "public", + "table": "tos_version", + "entityType": "indexes" + }, + { + "isRlsEnabled": false, + "name": "action_token", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "action_token_pkey", + "schema": "public", + "table": "action_token", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "action_token", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "action_token", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "purpose", + "schema": "public", + "table": "action_token", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token_hash", + "schema": "public", + "table": "action_token", + "entityType": "columns" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "action_token", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "token_hash" + ], + "nullsNotDistinct": false, + "name": "action_token_token_hash_unique", + "schema": "public", + "table": "action_token", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "user_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "purpose", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "action_token_user_purpose_uq", + "schema": "public", + "table": "action_token", + "entityType": "indexes" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "expires_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "action_token_expires_at_idx", + "schema": "public", + "table": "action_token", + "entityType": "indexes" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "action_token_user_id_user_id_fk", + "schema": "public", + "table": "action_token", + "entityType": "fks" + }, + { + "values": [ + "indoor", + "outdoor", + "mobile", + "unknown" + ], + "name": "exposure", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "homeV2Lora", + "homeV2Ethernet", + "homeV2Wifi", + "homeEthernet", + "homeWifi", + "homeEthernetFeinstaub", + "homeWifiFeinstaub", + "luftdaten_sds011", + "luftdaten_sds011_dht11", + "luftdaten_sds011_dht22", + "luftdaten_sds011_bmp180", + "luftdaten_sds011_bme280", + "hackair_home_v2", + "senseBox:Edu", + "luftdaten.info", + "custom" + ], + "name": "model", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "active", + "inactive", + "old" + ], + "name": "status", + "schema": "public", + "entityType": "enums" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/app/db/drizzle/0040_luxuriant_mathemanic.sql b/app/db/drizzle/20260325095346_luxuriant_mathemanic/migration.sql similarity index 100% rename from app/db/drizzle/0040_luxuriant_mathemanic.sql rename to app/db/drizzle/20260325095346_luxuriant_mathemanic/migration.sql diff --git a/app/db/drizzle/20260325095346_luxuriant_mathemanic/snapshot.json b/app/db/drizzle/20260325095346_luxuriant_mathemanic/snapshot.json new file mode 100644 index 000000000..6328fae08 --- /dev/null +++ b/app/db/drizzle/20260325095346_luxuriant_mathemanic/snapshot.json @@ -0,0 +1,2272 @@ +{ + "id": "1a430a1e-6dd4-473a-9e4a-8872c158f420", + "prevIds": [ + "b685080d-7e89-48b2-8e06-0f413d73f935" + ], + "version": "8", + "dialect": "postgres", + "ddl": [ + { + "isRlsEnabled": false, + "name": "device", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "device_pkey", + "schema": "public", + "table": "device", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "image", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "website", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 1, + "default": "ARRAY[]", + "generated": null, + "identity": null, + "name": "tags", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "link", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "use_auth", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "apiKey", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "exposure", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "exposure", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "model", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'custom'", + "generated": null, + "identity": null, + "name": "model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "archived_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "orphaned_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "date", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "latitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "longitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "device_user_id_user_id_fk", + "schema": "public", + "table": "device", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "device_to_location", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "columns": [ + "device_id", + "location_id", + "time" + ], + "nameExplicit": false, + "name": "device_to_location_device_id_location_id_time_pk", + "schema": "public", + "table": "device_to_location", + "entityType": "pks" + }, + { + "nameExplicit": false, + "columns": [ + "device_id", + "location_id", + "time" + ], + "nullsNotDistinct": false, + "name": "device_to_location_device_id_location_id_time_unique", + "schema": "public", + "table": "device_to_location", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "device_to_location_device_id_device_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "device_to_location_location_id_location_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "measurement", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "timestamp (3) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "sensor_id", + "time" + ], + "nullsNotDistinct": false, + "name": "measurement_sensor_id_time_unique", + "schema": "public", + "table": "measurement", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "measurement_location_id_location_id_fk", + "schema": "public", + "table": "measurement", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "password", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "columns": [ + "user_id" + ], + "nameExplicit": false, + "name": "password_pkey", + "schema": "public", + "table": "password", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "password_user_id_user_id_fk", + "schema": "public", + "table": "password", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_pkey", + "schema": "public", + "table": "profile", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "display_name", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "nullsNotDistinct": false, + "name": "profile_user_id_unique", + "schema": "public", + "table": "profile", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_user_id_user_id_fk", + "schema": "public", + "table": "profile", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile_image", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_image_pkey", + "schema": "public", + "table": "profile_image", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "alt_text", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content_type", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "blob", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "profile_id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "profile_id" + ], + "schemaTo": "public", + "tableTo": "profile", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_image_profile_id_profile_id_fk", + "schema": "public", + "table": "profile_image", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "sensor", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "sensor_pkey", + "schema": "public", + "table": "sensor", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "icon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_phenomenon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastMeasurement", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "data", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "order", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "sensor_device_id_device_id_fk", + "schema": "public", + "table": "sensor", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "user", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "user_pkey", + "schema": "public", + "table": "user", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unconfirmed_email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'user'", + "generated": null, + "identity": null, + "name": "role", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'en_US'", + "generated": null, + "identity": null, + "name": "language", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "email_is_confirmed", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "accepted_tos_version_id", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "accepted_tos_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "name" + ], + "nullsNotDistinct": false, + "name": "user_name_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "email" + ], + "nullsNotDistinct": false, + "name": "user_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "unconfirmed_email" + ], + "nullsNotDistinct": false, + "name": "user_unconfirmed_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "accepted_tos_version_id" + ], + "schemaTo": "public", + "tableTo": "tos_version", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "user_accepted_tos_version_id_tos_version_id_fk", + "schema": "public", + "table": "user", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "location", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "location_pkey", + "schema": "public", + "table": "location", + "entityType": "pks" + }, + { + "type": "bigserial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "type": "geometry(point)", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "location" + ], + "nullsNotDistinct": false, + "name": "location_location_unique", + "schema": "public", + "table": "location", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "location", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "gist", + "concurrently": false, + "name": "location_index", + "schema": "public", + "table": "location", + "entityType": "indexes" + }, + { + "isRlsEnabled": false, + "name": "log_entry", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "log_entry_pkey", + "schema": "public", + "table": "log_entry", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "refresh_token", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "refresh_token_user_id_user_id_fk", + "schema": "public", + "table": "refresh_token", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "token_revocation", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "claim", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "claim_pkey", + "schema": "public", + "table": "claim", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "box_id", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "nameExplicit": true, + "columns": [ + "box_id" + ], + "nullsNotDistinct": false, + "name": "unique_box_id", + "schema": "public", + "table": "claim", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "expires_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "claim_expires_at_idx", + "schema": "public", + "table": "claim", + "entityType": "indexes" + }, + { + "nameExplicit": false, + "columns": [ + "box_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "claim_box_id_device_id_fk", + "schema": "public", + "table": "claim", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "integration", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "integration_pkey", + "schema": "public", + "table": "integration", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "slug", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "service_url", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "service_key", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "icon", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "order", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "slug" + ], + "nullsNotDistinct": false, + "name": "integration_slug_unique", + "schema": "public", + "table": "integration", + "entityType": "uniques" + }, + { + "isRlsEnabled": false, + "name": "tos_user_state", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "tos_user_state", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "tos_version_id", + "schema": "public", + "table": "tos_user_state", + "entityType": "columns" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "accepted_at", + "schema": "public", + "table": "tos_user_state", + "entityType": "columns" + }, + { + "columns": [ + "user_id", + "tos_version_id" + ], + "nameExplicit": false, + "name": "tos_user_state_user_id_tos_version_id_pk", + "schema": "public", + "table": "tos_user_state", + "entityType": "pks" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "user_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "tos_user_state_user_idx", + "schema": "public", + "table": "tos_user_state", + "entityType": "indexes" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "tos_user_state_user_id_user_id_fk", + "schema": "public", + "table": "tos_user_state", + "entityType": "fks" + }, + { + "nameExplicit": false, + "columns": [ + "tos_version_id" + ], + "schemaTo": "public", + "tableTo": "tos_version", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "tos_user_state_tos_version_id_tos_version_id_fk", + "schema": "public", + "table": "tos_user_state", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "tos_version", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "tos_version_pkey", + "schema": "public", + "table": "tos_version", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "version", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "body", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "effective_from", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "accept_by", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "version" + ], + "nullsNotDistinct": false, + "name": "tos_version_version_unique", + "schema": "public", + "table": "tos_version", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "effective_from", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "tos_version_effective_from_idx", + "schema": "public", + "table": "tos_version", + "entityType": "indexes" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "accept_by", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "tos_version_accept_by_idx", + "schema": "public", + "table": "tos_version", + "entityType": "indexes" + }, + { + "isRlsEnabled": false, + "name": "action_token", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "action_token_pkey", + "schema": "public", + "table": "action_token", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "action_token", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "action_token", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "purpose", + "schema": "public", + "table": "action_token", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token_hash", + "schema": "public", + "table": "action_token", + "entityType": "columns" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "action_token", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "token_hash" + ], + "nullsNotDistinct": false, + "name": "action_token_token_hash_unique", + "schema": "public", + "table": "action_token", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "user_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "purpose", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "action_token_user_purpose_uq", + "schema": "public", + "table": "action_token", + "entityType": "indexes" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "expires_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "action_token_expires_at_idx", + "schema": "public", + "table": "action_token", + "entityType": "indexes" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "action_token_user_id_user_id_fk", + "schema": "public", + "table": "action_token", + "entityType": "fks" + }, + { + "values": [ + "indoor", + "outdoor", + "mobile", + "unknown" + ], + "name": "exposure", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "homeV2Lora", + "homeV2Ethernet", + "homeV2Wifi", + "homeEthernet", + "homeWifi", + "homeEthernetFeinstaub", + "homeWifiFeinstaub", + "luftdaten_sds011", + "luftdaten_sds011_dht11", + "luftdaten_sds011_dht22", + "luftdaten_sds011_bmp180", + "luftdaten_sds011_bme280", + "hackair_home_v2", + "senseBox:Edu", + "luftdaten.info", + "custom" + ], + "name": "model", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "active", + "inactive", + "old" + ], + "name": "status", + "schema": "public", + "entityType": "enums" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/app/db/drizzle/0041_cleanup_expired_tos_users.sql b/app/db/drizzle/20260325101029_cleanup_expired_tos_users/migration.sql similarity index 100% rename from app/db/drizzle/0041_cleanup_expired_tos_users.sql rename to app/db/drizzle/20260325101029_cleanup_expired_tos_users/migration.sql diff --git a/app/db/drizzle/20260325101029_cleanup_expired_tos_users/snapshot.json b/app/db/drizzle/20260325101029_cleanup_expired_tos_users/snapshot.json new file mode 100644 index 000000000..ed9446621 --- /dev/null +++ b/app/db/drizzle/20260325101029_cleanup_expired_tos_users/snapshot.json @@ -0,0 +1,2272 @@ +{ + "id": "aff47dec-8f78-438d-adb7-ff7b2c7e676b", + "prevIds": [ + "1a430a1e-6dd4-473a-9e4a-8872c158f420" + ], + "version": "8", + "dialect": "postgres", + "ddl": [ + { + "isRlsEnabled": false, + "name": "device", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "device_pkey", + "schema": "public", + "table": "device", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "image", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "website", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 1, + "default": "ARRAY[]", + "generated": null, + "identity": null, + "name": "tags", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "link", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "use_auth", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "apiKey", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "exposure", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "exposure", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "model", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'custom'", + "generated": null, + "identity": null, + "name": "model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "archived_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "orphaned_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "date", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "latitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "longitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "device_user_id_user_id_fk", + "schema": "public", + "table": "device", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "device_to_location", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "columns": [ + "device_id", + "location_id", + "time" + ], + "nameExplicit": false, + "name": "device_to_location_device_id_location_id_time_pk", + "schema": "public", + "table": "device_to_location", + "entityType": "pks" + }, + { + "nameExplicit": false, + "columns": [ + "device_id", + "location_id", + "time" + ], + "nullsNotDistinct": false, + "name": "device_to_location_device_id_location_id_time_unique", + "schema": "public", + "table": "device_to_location", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "device_to_location_device_id_device_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "device_to_location_location_id_location_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "measurement", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "timestamp (3) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "sensor_id", + "time" + ], + "nullsNotDistinct": false, + "name": "measurement_sensor_id_time_unique", + "schema": "public", + "table": "measurement", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "measurement_location_id_location_id_fk", + "schema": "public", + "table": "measurement", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "password", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "columns": [ + "user_id" + ], + "nameExplicit": false, + "name": "password_pkey", + "schema": "public", + "table": "password", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "password_user_id_user_id_fk", + "schema": "public", + "table": "password", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_pkey", + "schema": "public", + "table": "profile", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "display_name", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "nullsNotDistinct": false, + "name": "profile_user_id_unique", + "schema": "public", + "table": "profile", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_user_id_user_id_fk", + "schema": "public", + "table": "profile", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile_image", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_image_pkey", + "schema": "public", + "table": "profile_image", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "alt_text", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content_type", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "blob", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "profile_id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "profile_id" + ], + "schemaTo": "public", + "tableTo": "profile", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_image_profile_id_profile_id_fk", + "schema": "public", + "table": "profile_image", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "sensor", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "sensor_pkey", + "schema": "public", + "table": "sensor", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "icon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_phenomenon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastMeasurement", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "data", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "order", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "sensor_device_id_device_id_fk", + "schema": "public", + "table": "sensor", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "user", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "user_pkey", + "schema": "public", + "table": "user", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unconfirmed_email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'user'", + "generated": null, + "identity": null, + "name": "role", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'en_US'", + "generated": null, + "identity": null, + "name": "language", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "email_is_confirmed", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "accepted_tos_version_id", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "accepted_tos_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "name" + ], + "nullsNotDistinct": false, + "name": "user_name_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "email" + ], + "nullsNotDistinct": false, + "name": "user_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "unconfirmed_email" + ], + "nullsNotDistinct": false, + "name": "user_unconfirmed_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "accepted_tos_version_id" + ], + "schemaTo": "public", + "tableTo": "tos_version", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "user_accepted_tos_version_id_tos_version_id_fk", + "schema": "public", + "table": "user", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "location", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "location_pkey", + "schema": "public", + "table": "location", + "entityType": "pks" + }, + { + "type": "bigserial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "type": "geometry(point)", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "location" + ], + "nullsNotDistinct": false, + "name": "location_location_unique", + "schema": "public", + "table": "location", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "location", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "gist", + "concurrently": false, + "name": "location_index", + "schema": "public", + "table": "location", + "entityType": "indexes" + }, + { + "isRlsEnabled": false, + "name": "log_entry", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "log_entry_pkey", + "schema": "public", + "table": "log_entry", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "refresh_token", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "refresh_token_user_id_user_id_fk", + "schema": "public", + "table": "refresh_token", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "token_revocation", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "claim", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "claim_pkey", + "schema": "public", + "table": "claim", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "box_id", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "nameExplicit": true, + "columns": [ + "box_id" + ], + "nullsNotDistinct": false, + "name": "unique_box_id", + "schema": "public", + "table": "claim", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "expires_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "claim_expires_at_idx", + "schema": "public", + "table": "claim", + "entityType": "indexes" + }, + { + "nameExplicit": false, + "columns": [ + "box_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "claim_box_id_device_id_fk", + "schema": "public", + "table": "claim", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "integration", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "integration_pkey", + "schema": "public", + "table": "integration", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "slug", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "service_url", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "service_key", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "icon", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "order", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "slug" + ], + "nullsNotDistinct": false, + "name": "integration_slug_unique", + "schema": "public", + "table": "integration", + "entityType": "uniques" + }, + { + "isRlsEnabled": false, + "name": "tos_user_state", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "tos_user_state", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "tos_version_id", + "schema": "public", + "table": "tos_user_state", + "entityType": "columns" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "accepted_at", + "schema": "public", + "table": "tos_user_state", + "entityType": "columns" + }, + { + "columns": [ + "user_id", + "tos_version_id" + ], + "nameExplicit": false, + "name": "tos_user_state_user_id_tos_version_id_pk", + "schema": "public", + "table": "tos_user_state", + "entityType": "pks" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "user_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "tos_user_state_user_idx", + "schema": "public", + "table": "tos_user_state", + "entityType": "indexes" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "tos_user_state_user_id_user_id_fk", + "schema": "public", + "table": "tos_user_state", + "entityType": "fks" + }, + { + "nameExplicit": false, + "columns": [ + "tos_version_id" + ], + "schemaTo": "public", + "tableTo": "tos_version", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "tos_user_state_tos_version_id_tos_version_id_fk", + "schema": "public", + "table": "tos_user_state", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "tos_version", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "tos_version_pkey", + "schema": "public", + "table": "tos_version", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "version", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "body", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "effective_from", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "accept_by", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "version" + ], + "nullsNotDistinct": false, + "name": "tos_version_version_unique", + "schema": "public", + "table": "tos_version", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "effective_from", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "tos_version_effective_from_idx", + "schema": "public", + "table": "tos_version", + "entityType": "indexes" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "accept_by", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "tos_version_accept_by_idx", + "schema": "public", + "table": "tos_version", + "entityType": "indexes" + }, + { + "isRlsEnabled": false, + "name": "action_token", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "action_token_pkey", + "schema": "public", + "table": "action_token", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "action_token", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "action_token", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "purpose", + "schema": "public", + "table": "action_token", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token_hash", + "schema": "public", + "table": "action_token", + "entityType": "columns" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "action_token", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "token_hash" + ], + "nullsNotDistinct": false, + "name": "action_token_token_hash_unique", + "schema": "public", + "table": "action_token", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "user_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "purpose", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "action_token_user_purpose_uq", + "schema": "public", + "table": "action_token", + "entityType": "indexes" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "expires_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "action_token_expires_at_idx", + "schema": "public", + "table": "action_token", + "entityType": "indexes" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "action_token_user_id_user_id_fk", + "schema": "public", + "table": "action_token", + "entityType": "fks" + }, + { + "values": [ + "indoor", + "outdoor", + "mobile", + "unknown" + ], + "name": "exposure", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "homeV2Lora", + "homeV2Ethernet", + "homeV2Wifi", + "homeEthernet", + "homeWifi", + "homeEthernetFeinstaub", + "homeWifiFeinstaub", + "luftdaten_sds011", + "luftdaten_sds011_dht11", + "luftdaten_sds011_dht22", + "luftdaten_sds011_bmp180", + "luftdaten_sds011_bme280", + "hackair_home_v2", + "senseBox:Edu", + "luftdaten.info", + "custom" + ], + "name": "model", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "active", + "inactive", + "old" + ], + "name": "status", + "schema": "public", + "entityType": "enums" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/app/db/drizzle/0042_medical_blackheart.sql b/app/db/drizzle/20260512143407_medical_blackheart/migration.sql similarity index 100% rename from app/db/drizzle/0042_medical_blackheart.sql rename to app/db/drizzle/20260512143407_medical_blackheart/migration.sql diff --git a/app/db/drizzle/20260512143407_medical_blackheart/snapshot.json b/app/db/drizzle/20260512143407_medical_blackheart/snapshot.json new file mode 100644 index 000000000..0c9a9d4a6 --- /dev/null +++ b/app/db/drizzle/20260512143407_medical_blackheart/snapshot.json @@ -0,0 +1,2272 @@ +{ + "id": "86afca58-d04e-41b3-8a69-9a4b4bfe24a4", + "prevIds": [ + "aff47dec-8f78-438d-adb7-ff7b2c7e676b" + ], + "version": "8", + "dialect": "postgres", + "ddl": [ + { + "isRlsEnabled": false, + "name": "device", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "device_pkey", + "schema": "public", + "table": "device", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "image", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "website", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 1, + "default": "ARRAY[]", + "generated": null, + "identity": null, + "name": "tags", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "link", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "use_auth", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "apiKey", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "exposure", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "exposure", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "model", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'custom'", + "generated": null, + "identity": null, + "name": "model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "archived_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "orphaned_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "date", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "latitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "longitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "device_user_id_user_id_fk", + "schema": "public", + "table": "device", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "device_to_location", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "columns": [ + "device_id", + "location_id", + "time" + ], + "nameExplicit": false, + "name": "device_to_location_device_id_location_id_time_pk", + "schema": "public", + "table": "device_to_location", + "entityType": "pks" + }, + { + "nameExplicit": false, + "columns": [ + "device_id", + "location_id", + "time" + ], + "nullsNotDistinct": false, + "name": "device_to_location_device_id_location_id_time_unique", + "schema": "public", + "table": "device_to_location", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "device_to_location_device_id_device_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "device_to_location_location_id_location_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "measurement", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "timestamp (3) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "sensor_id", + "time" + ], + "nullsNotDistinct": false, + "name": "measurement_sensor_id_time_unique", + "schema": "public", + "table": "measurement", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "measurement_location_id_location_id_fk", + "schema": "public", + "table": "measurement", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "password", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "columns": [ + "user_id" + ], + "nameExplicit": false, + "name": "password_pkey", + "schema": "public", + "table": "password", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "password_user_id_user_id_fk", + "schema": "public", + "table": "password", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_pkey", + "schema": "public", + "table": "profile", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "display_name", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "nullsNotDistinct": false, + "name": "profile_user_id_unique", + "schema": "public", + "table": "profile", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_user_id_user_id_fk", + "schema": "public", + "table": "profile", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile_image", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_image_pkey", + "schema": "public", + "table": "profile_image", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "alt_text", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content_type", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "blob", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "profile_id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "profile_id" + ], + "schemaTo": "public", + "tableTo": "profile", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_image_profile_id_profile_id_fk", + "schema": "public", + "table": "profile_image", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "sensor", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "sensor_pkey", + "schema": "public", + "table": "sensor", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "icon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_phenomenon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastMeasurement", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "data", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "order", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "sensor_device_id_device_id_fk", + "schema": "public", + "table": "sensor", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "user", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "user_pkey", + "schema": "public", + "table": "user", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unconfirmed_email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'user'", + "generated": null, + "identity": null, + "name": "role", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'en_US'", + "generated": null, + "identity": null, + "name": "language", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "email_is_confirmed", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "accepted_tos_version_id", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "accepted_tos_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "name" + ], + "nullsNotDistinct": false, + "name": "user_name_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "email" + ], + "nullsNotDistinct": false, + "name": "user_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "unconfirmed_email" + ], + "nullsNotDistinct": false, + "name": "user_unconfirmed_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "accepted_tos_version_id" + ], + "schemaTo": "public", + "tableTo": "tos_version", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "user_accepted_tos_version_id_tos_version_id_fk", + "schema": "public", + "table": "user", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "location", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "location_pkey", + "schema": "public", + "table": "location", + "entityType": "pks" + }, + { + "type": "bigserial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "type": "geometry(point)", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "location" + ], + "nullsNotDistinct": false, + "name": "location_location_unique", + "schema": "public", + "table": "location", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "location", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "gist", + "concurrently": false, + "name": "location_index", + "schema": "public", + "table": "location", + "entityType": "indexes" + }, + { + "isRlsEnabled": false, + "name": "log_entry", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "log_entry_pkey", + "schema": "public", + "table": "log_entry", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "refresh_token", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "refresh_token_user_id_user_id_fk", + "schema": "public", + "table": "refresh_token", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "token_revocation", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "claim", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "claim_pkey", + "schema": "public", + "table": "claim", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "box_id", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "nameExplicit": true, + "columns": [ + "box_id" + ], + "nullsNotDistinct": false, + "name": "unique_box_id", + "schema": "public", + "table": "claim", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "expires_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "claim_expires_at_idx", + "schema": "public", + "table": "claim", + "entityType": "indexes" + }, + { + "nameExplicit": false, + "columns": [ + "box_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "claim_box_id_device_id_fk", + "schema": "public", + "table": "claim", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "integration", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "integration_pkey", + "schema": "public", + "table": "integration", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "slug", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "service_url", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "service_key", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "icon", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "order", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "slug" + ], + "nullsNotDistinct": false, + "name": "integration_slug_unique", + "schema": "public", + "table": "integration", + "entityType": "uniques" + }, + { + "isRlsEnabled": false, + "name": "tos_user_state", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "tos_user_state", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "tos_version_id", + "schema": "public", + "table": "tos_user_state", + "entityType": "columns" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "accepted_at", + "schema": "public", + "table": "tos_user_state", + "entityType": "columns" + }, + { + "columns": [ + "user_id", + "tos_version_id" + ], + "nameExplicit": false, + "name": "tos_user_state_user_id_tos_version_id_pk", + "schema": "public", + "table": "tos_user_state", + "entityType": "pks" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "user_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "tos_user_state_user_idx", + "schema": "public", + "table": "tos_user_state", + "entityType": "indexes" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "tos_user_state_user_id_user_id_fk", + "schema": "public", + "table": "tos_user_state", + "entityType": "fks" + }, + { + "nameExplicit": false, + "columns": [ + "tos_version_id" + ], + "schemaTo": "public", + "tableTo": "tos_version", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "tos_user_state_tos_version_id_tos_version_id_fk", + "schema": "public", + "table": "tos_user_state", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "tos_version", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "tos_version_pkey", + "schema": "public", + "table": "tos_version", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "version", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "body", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "effective_from", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "accept_by", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "version" + ], + "nullsNotDistinct": false, + "name": "tos_version_version_unique", + "schema": "public", + "table": "tos_version", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "effective_from", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "tos_version_effective_from_idx", + "schema": "public", + "table": "tos_version", + "entityType": "indexes" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "accept_by", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "tos_version_accept_by_idx", + "schema": "public", + "table": "tos_version", + "entityType": "indexes" + }, + { + "isRlsEnabled": false, + "name": "action_token", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "action_token_pkey", + "schema": "public", + "table": "action_token", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "action_token", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "action_token", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "purpose", + "schema": "public", + "table": "action_token", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token_hash", + "schema": "public", + "table": "action_token", + "entityType": "columns" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "action_token", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "token_hash" + ], + "nullsNotDistinct": false, + "name": "action_token_token_hash_unique", + "schema": "public", + "table": "action_token", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "user_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "purpose", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "action_token_user_purpose_uq", + "schema": "public", + "table": "action_token", + "entityType": "indexes" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "expires_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "action_token_expires_at_idx", + "schema": "public", + "table": "action_token", + "entityType": "indexes" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "action_token_user_id_user_id_fk", + "schema": "public", + "table": "action_token", + "entityType": "fks" + }, + { + "values": [ + "indoor", + "outdoor", + "mobile", + "unknown" + ], + "name": "exposure", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "homeV2Lora", + "homeV2Ethernet", + "homeV2Wifi", + "homeEthernet", + "homeWifi", + "homeEthernetFeinstaub", + "homeWifiFeinstaub", + "luftdaten_sds011", + "luftdaten_sds011_dht11", + "luftdaten_sds011_dht22", + "luftdaten_sds011_bmp180", + "luftdaten_sds011_bme280", + "hackair_home_v2", + "senseBox:Edu", + "luftdaten.info", + "custom" + ], + "name": "model", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "active", + "inactive", + "old" + ], + "name": "status", + "schema": "public", + "entityType": "enums" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/app/db/drizzle/0043_flowery_bedlam.sql b/app/db/drizzle/20260610090146_flowery_bedlam/migration.sql similarity index 100% rename from app/db/drizzle/0043_flowery_bedlam.sql rename to app/db/drizzle/20260610090146_flowery_bedlam/migration.sql diff --git a/app/db/drizzle/20260610090146_flowery_bedlam/snapshot.json b/app/db/drizzle/20260610090146_flowery_bedlam/snapshot.json new file mode 100644 index 000000000..b73fa458d --- /dev/null +++ b/app/db/drizzle/20260610090146_flowery_bedlam/snapshot.json @@ -0,0 +1,2295 @@ +{ + "id": "07740930-4c95-45f7-8d50-1115b8954086", + "prevIds": [ + "86afca58-d04e-41b3-8a69-9a4b4bfe24a4" + ], + "version": "8", + "dialect": "postgres", + "ddl": [ + { + "isRlsEnabled": false, + "name": "device", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "device_pkey", + "schema": "public", + "table": "device", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "image", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "website", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 1, + "default": "ARRAY[]", + "generated": null, + "identity": null, + "name": "tags", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "link", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "use_auth", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "apiKey", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "exposure", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "exposure", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "model", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'custom'", + "generated": null, + "identity": null, + "name": "model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "archived_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "orphaned_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "date", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "latitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "longitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "device_user_id_user_id_fk", + "schema": "public", + "table": "device", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "device_to_location", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "columns": [ + "device_id", + "location_id", + "time" + ], + "nameExplicit": false, + "name": "device_to_location_device_id_location_id_time_pk", + "schema": "public", + "table": "device_to_location", + "entityType": "pks" + }, + { + "nameExplicit": false, + "columns": [ + "device_id", + "location_id", + "time" + ], + "nullsNotDistinct": false, + "name": "device_to_location_device_id_location_id_time_unique", + "schema": "public", + "table": "device_to_location", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "device_to_location_device_id_device_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "device_to_location_location_id_location_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "measurement", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "timestamp (3) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "sensor_id", + "time" + ], + "nullsNotDistinct": false, + "name": "measurement_sensor_id_time_unique", + "schema": "public", + "table": "measurement", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "measurement_location_id_location_id_fk", + "schema": "public", + "table": "measurement", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "password", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "columns": [ + "user_id" + ], + "nameExplicit": false, + "name": "password_pkey", + "schema": "public", + "table": "password", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "password_user_id_user_id_fk", + "schema": "public", + "table": "password", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_pkey", + "schema": "public", + "table": "profile", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "display_name", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "nullsNotDistinct": false, + "name": "profile_user_id_unique", + "schema": "public", + "table": "profile", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_user_id_user_id_fk", + "schema": "public", + "table": "profile", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile_image", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_image_pkey", + "schema": "public", + "table": "profile_image", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "alt_text", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content_type", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "blob", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "profile_id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "profile_id" + ], + "schemaTo": "public", + "tableTo": "profile", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_image_profile_id_profile_id_fk", + "schema": "public", + "table": "profile_image", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "sensor", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "sensor_pkey", + "schema": "public", + "table": "sensor", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "icon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_phenomenon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastMeasurement", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "data", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "order", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "sensor_device_id_device_id_fk", + "schema": "public", + "table": "sensor", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "user", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "user_pkey", + "schema": "public", + "table": "user", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unconfirmed_email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "theme_preference", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": "'system'", + "generated": null, + "identity": null, + "name": "theme_preference", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'user'", + "generated": null, + "identity": null, + "name": "role", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'en_US'", + "generated": null, + "identity": null, + "name": "language", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "email_is_confirmed", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "accepted_tos_version_id", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "accepted_tos_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "name" + ], + "nullsNotDistinct": false, + "name": "user_name_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "email" + ], + "nullsNotDistinct": false, + "name": "user_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "unconfirmed_email" + ], + "nullsNotDistinct": false, + "name": "user_unconfirmed_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "accepted_tos_version_id" + ], + "schemaTo": "public", + "tableTo": "tos_version", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "user_accepted_tos_version_id_tos_version_id_fk", + "schema": "public", + "table": "user", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "location", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "location_pkey", + "schema": "public", + "table": "location", + "entityType": "pks" + }, + { + "type": "bigserial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "type": "geometry(point)", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "location" + ], + "nullsNotDistinct": false, + "name": "location_location_unique", + "schema": "public", + "table": "location", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "location", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "gist", + "concurrently": false, + "name": "location_index", + "schema": "public", + "table": "location", + "entityType": "indexes" + }, + { + "isRlsEnabled": false, + "name": "log_entry", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "log_entry_pkey", + "schema": "public", + "table": "log_entry", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "refresh_token", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "refresh_token_user_id_user_id_fk", + "schema": "public", + "table": "refresh_token", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "token_revocation", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "claim", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "claim_pkey", + "schema": "public", + "table": "claim", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "box_id", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "nameExplicit": true, + "columns": [ + "box_id" + ], + "nullsNotDistinct": false, + "name": "unique_box_id", + "schema": "public", + "table": "claim", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "expires_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "claim_expires_at_idx", + "schema": "public", + "table": "claim", + "entityType": "indexes" + }, + { + "nameExplicit": false, + "columns": [ + "box_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "claim_box_id_device_id_fk", + "schema": "public", + "table": "claim", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "integration", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "integration_pkey", + "schema": "public", + "table": "integration", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "slug", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "service_url", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "service_key", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "icon", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "order", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "slug" + ], + "nullsNotDistinct": false, + "name": "integration_slug_unique", + "schema": "public", + "table": "integration", + "entityType": "uniques" + }, + { + "isRlsEnabled": false, + "name": "tos_user_state", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "tos_user_state", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "tos_version_id", + "schema": "public", + "table": "tos_user_state", + "entityType": "columns" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "accepted_at", + "schema": "public", + "table": "tos_user_state", + "entityType": "columns" + }, + { + "columns": [ + "user_id", + "tos_version_id" + ], + "nameExplicit": false, + "name": "tos_user_state_user_id_tos_version_id_pk", + "schema": "public", + "table": "tos_user_state", + "entityType": "pks" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "user_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "tos_user_state_user_idx", + "schema": "public", + "table": "tos_user_state", + "entityType": "indexes" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "tos_user_state_user_id_user_id_fk", + "schema": "public", + "table": "tos_user_state", + "entityType": "fks" + }, + { + "nameExplicit": false, + "columns": [ + "tos_version_id" + ], + "schemaTo": "public", + "tableTo": "tos_version", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "tos_user_state_tos_version_id_tos_version_id_fk", + "schema": "public", + "table": "tos_user_state", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "tos_version", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "tos_version_pkey", + "schema": "public", + "table": "tos_version", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "version", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "body", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "effective_from", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "accept_by", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "version" + ], + "nullsNotDistinct": false, + "name": "tos_version_version_unique", + "schema": "public", + "table": "tos_version", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "effective_from", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "tos_version_effective_from_idx", + "schema": "public", + "table": "tos_version", + "entityType": "indexes" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "accept_by", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "tos_version_accept_by_idx", + "schema": "public", + "table": "tos_version", + "entityType": "indexes" + }, + { + "isRlsEnabled": false, + "name": "action_token", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "action_token_pkey", + "schema": "public", + "table": "action_token", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "action_token", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "action_token", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "purpose", + "schema": "public", + "table": "action_token", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token_hash", + "schema": "public", + "table": "action_token", + "entityType": "columns" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "action_token", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "token_hash" + ], + "nullsNotDistinct": false, + "name": "action_token_token_hash_unique", + "schema": "public", + "table": "action_token", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "user_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "purpose", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "action_token_user_purpose_uq", + "schema": "public", + "table": "action_token", + "entityType": "indexes" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "expires_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "action_token_expires_at_idx", + "schema": "public", + "table": "action_token", + "entityType": "indexes" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "action_token_user_id_user_id_fk", + "schema": "public", + "table": "action_token", + "entityType": "fks" + }, + { + "values": [ + "indoor", + "outdoor", + "mobile", + "unknown" + ], + "name": "exposure", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "homeV2Lora", + "homeV2Ethernet", + "homeV2Wifi", + "homeEthernet", + "homeWifi", + "homeEthernetFeinstaub", + "homeWifiFeinstaub", + "luftdaten_sds011", + "luftdaten_sds011_dht11", + "luftdaten_sds011_dht22", + "luftdaten_sds011_bmp180", + "luftdaten_sds011_bme280", + "hackair_home_v2", + "senseBox:Edu", + "luftdaten.info", + "custom" + ], + "name": "model", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "active", + "inactive", + "old" + ], + "name": "status", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "light", + "dark", + "system" + ], + "name": "theme_preference", + "schema": "public", + "entityType": "enums" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/app/db/drizzle/0044_dusty_ultragirl.sql b/app/db/drizzle/20260617144323_dusty_ultragirl/migration.sql similarity index 100% rename from app/db/drizzle/0044_dusty_ultragirl.sql rename to app/db/drizzle/20260617144323_dusty_ultragirl/migration.sql diff --git a/app/db/drizzle/20260617144323_dusty_ultragirl/snapshot.json b/app/db/drizzle/20260617144323_dusty_ultragirl/snapshot.json new file mode 100644 index 000000000..94095448c --- /dev/null +++ b/app/db/drizzle/20260617144323_dusty_ultragirl/snapshot.json @@ -0,0 +1,2334 @@ +{ + "id": "455bb6e0-7317-40b3-9d71-ef56f4443540", + "prevIds": [ + "07740930-4c95-45f7-8d50-1115b8954086" + ], + "version": "8", + "dialect": "postgres", + "ddl": [ + { + "isRlsEnabled": false, + "name": "device", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "device_pkey", + "schema": "public", + "table": "device", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "image", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "website", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 1, + "default": "ARRAY[]", + "generated": null, + "identity": null, + "name": "tags", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "link", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "use_auth", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "apiKey", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "exposure", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "exposure", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "model", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'custom'", + "generated": null, + "identity": null, + "name": "model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "archived_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "orphaned_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "date", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "latitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "longitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "device_user_id_user_id_fk", + "schema": "public", + "table": "device", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "device_to_location", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "columns": [ + "device_id", + "location_id", + "time" + ], + "nameExplicit": false, + "name": "device_to_location_device_id_location_id_time_pk", + "schema": "public", + "table": "device_to_location", + "entityType": "pks" + }, + { + "nameExplicit": false, + "columns": [ + "device_id", + "location_id", + "time" + ], + "nullsNotDistinct": false, + "name": "device_to_location_device_id_location_id_time_unique", + "schema": "public", + "table": "device_to_location", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "device_to_location_device_id_device_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "device_to_location_location_id_location_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "measurement", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "timestamp (3) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "sensor_id", + "time" + ], + "nullsNotDistinct": false, + "name": "measurement_sensor_id_time_unique", + "schema": "public", + "table": "measurement", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "measurement_location_id_location_id_fk", + "schema": "public", + "table": "measurement", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "password", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "columns": [ + "user_id" + ], + "nameExplicit": false, + "name": "password_pkey", + "schema": "public", + "table": "password", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "password_user_id_user_id_fk", + "schema": "public", + "table": "password", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_pkey", + "schema": "public", + "table": "profile", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "display_name", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "home_latitude", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "home_longitude", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "real", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "10", + "generated": null, + "identity": null, + "name": "home_zoom", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "nullsNotDistinct": false, + "name": "profile_user_id_unique", + "schema": "public", + "table": "profile", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_user_id_user_id_fk", + "schema": "public", + "table": "profile", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile_image", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_image_pkey", + "schema": "public", + "table": "profile_image", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "alt_text", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content_type", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "blob", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "profile_id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "profile_id" + ], + "schemaTo": "public", + "tableTo": "profile", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_image_profile_id_profile_id_fk", + "schema": "public", + "table": "profile_image", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "sensor", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "sensor_pkey", + "schema": "public", + "table": "sensor", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "icon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_phenomenon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastMeasurement", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "data", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "order", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "sensor_device_id_device_id_fk", + "schema": "public", + "table": "sensor", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "user", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "user_pkey", + "schema": "public", + "table": "user", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unconfirmed_email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "theme_preference", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": "'system'", + "generated": null, + "identity": null, + "name": "theme_preference", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'user'", + "generated": null, + "identity": null, + "name": "role", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'en_US'", + "generated": null, + "identity": null, + "name": "language", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "email_is_confirmed", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "accepted_tos_version_id", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "accepted_tos_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "name" + ], + "nullsNotDistinct": false, + "name": "user_name_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "email" + ], + "nullsNotDistinct": false, + "name": "user_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "unconfirmed_email" + ], + "nullsNotDistinct": false, + "name": "user_unconfirmed_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "accepted_tos_version_id" + ], + "schemaTo": "public", + "tableTo": "tos_version", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "user_accepted_tos_version_id_tos_version_id_fk", + "schema": "public", + "table": "user", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "location", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "location_pkey", + "schema": "public", + "table": "location", + "entityType": "pks" + }, + { + "type": "bigserial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "type": "geometry(point)", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "location" + ], + "nullsNotDistinct": false, + "name": "location_location_unique", + "schema": "public", + "table": "location", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "location", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "gist", + "concurrently": false, + "name": "location_index", + "schema": "public", + "table": "location", + "entityType": "indexes" + }, + { + "isRlsEnabled": false, + "name": "log_entry", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "log_entry_pkey", + "schema": "public", + "table": "log_entry", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "refresh_token", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "refresh_token_user_id_user_id_fk", + "schema": "public", + "table": "refresh_token", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "token_revocation", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "claim", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "claim_pkey", + "schema": "public", + "table": "claim", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "box_id", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "nameExplicit": true, + "columns": [ + "box_id" + ], + "nullsNotDistinct": false, + "name": "unique_box_id", + "schema": "public", + "table": "claim", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "expires_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "claim_expires_at_idx", + "schema": "public", + "table": "claim", + "entityType": "indexes" + }, + { + "nameExplicit": false, + "columns": [ + "box_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "claim_box_id_device_id_fk", + "schema": "public", + "table": "claim", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "integration", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "integration_pkey", + "schema": "public", + "table": "integration", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "slug", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "service_url", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "service_key", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "icon", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "order", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "slug" + ], + "nullsNotDistinct": false, + "name": "integration_slug_unique", + "schema": "public", + "table": "integration", + "entityType": "uniques" + }, + { + "isRlsEnabled": false, + "name": "tos_user_state", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "tos_user_state", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "tos_version_id", + "schema": "public", + "table": "tos_user_state", + "entityType": "columns" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "accepted_at", + "schema": "public", + "table": "tos_user_state", + "entityType": "columns" + }, + { + "columns": [ + "user_id", + "tos_version_id" + ], + "nameExplicit": false, + "name": "tos_user_state_user_id_tos_version_id_pk", + "schema": "public", + "table": "tos_user_state", + "entityType": "pks" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "user_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "tos_user_state_user_idx", + "schema": "public", + "table": "tos_user_state", + "entityType": "indexes" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "tos_user_state_user_id_user_id_fk", + "schema": "public", + "table": "tos_user_state", + "entityType": "fks" + }, + { + "nameExplicit": false, + "columns": [ + "tos_version_id" + ], + "schemaTo": "public", + "tableTo": "tos_version", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "tos_user_state_tos_version_id_tos_version_id_fk", + "schema": "public", + "table": "tos_user_state", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "tos_version", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "tos_version_pkey", + "schema": "public", + "table": "tos_version", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "version", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "body", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "effective_from", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "accept_by", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "version" + ], + "nullsNotDistinct": false, + "name": "tos_version_version_unique", + "schema": "public", + "table": "tos_version", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "effective_from", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "tos_version_effective_from_idx", + "schema": "public", + "table": "tos_version", + "entityType": "indexes" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "accept_by", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "tos_version_accept_by_idx", + "schema": "public", + "table": "tos_version", + "entityType": "indexes" + }, + { + "isRlsEnabled": false, + "name": "action_token", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "action_token_pkey", + "schema": "public", + "table": "action_token", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "action_token", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "action_token", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "purpose", + "schema": "public", + "table": "action_token", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token_hash", + "schema": "public", + "table": "action_token", + "entityType": "columns" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "action_token", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "token_hash" + ], + "nullsNotDistinct": false, + "name": "action_token_token_hash_unique", + "schema": "public", + "table": "action_token", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "user_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "purpose", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "action_token_user_purpose_uq", + "schema": "public", + "table": "action_token", + "entityType": "indexes" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "expires_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "action_token_expires_at_idx", + "schema": "public", + "table": "action_token", + "entityType": "indexes" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "action_token_user_id_user_id_fk", + "schema": "public", + "table": "action_token", + "entityType": "fks" + }, + { + "values": [ + "indoor", + "outdoor", + "mobile", + "unknown" + ], + "name": "exposure", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "homeV2Lora", + "homeV2Ethernet", + "homeV2Wifi", + "homeEthernet", + "homeWifi", + "homeEthernetFeinstaub", + "homeWifiFeinstaub", + "luftdaten_sds011", + "luftdaten_sds011_dht11", + "luftdaten_sds011_dht22", + "luftdaten_sds011_bmp180", + "luftdaten_sds011_bme280", + "hackair_home_v2", + "senseBox:Edu", + "luftdaten.info", + "custom" + ], + "name": "model", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "active", + "inactive", + "old" + ], + "name": "status", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "light", + "dark", + "system" + ], + "name": "theme_preference", + "schema": "public", + "entityType": "enums" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/app/db/drizzle/0045_blushing_chameleon.sql b/app/db/drizzle/20260622094740_blushing_chameleon/migration.sql similarity index 100% rename from app/db/drizzle/0045_blushing_chameleon.sql rename to app/db/drizzle/20260622094740_blushing_chameleon/migration.sql diff --git a/app/db/drizzle/20260622094740_blushing_chameleon/snapshot.json b/app/db/drizzle/20260622094740_blushing_chameleon/snapshot.json new file mode 100644 index 000000000..20be3aa3c --- /dev/null +++ b/app/db/drizzle/20260622094740_blushing_chameleon/snapshot.json @@ -0,0 +1,2347 @@ +{ + "id": "ef9b819e-831a-4fac-8183-8eb681b40a71", + "prevIds": [ + "455bb6e0-7317-40b3-9d71-ef56f4443540" + ], + "version": "8", + "dialect": "postgres", + "ddl": [ + { + "isRlsEnabled": false, + "name": "device", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "device_pkey", + "schema": "public", + "table": "device", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "image", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "website", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 1, + "default": "ARRAY[]", + "generated": null, + "identity": null, + "name": "tags", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "link", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "use_auth", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "apiKey", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "exposure", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "exposure", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "model", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'custom'", + "generated": null, + "identity": null, + "name": "model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "archived_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "orphaned_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "date", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "latitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "longitude", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_model", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "device", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "device_user_id_user_id_fk", + "schema": "public", + "table": "device", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "device_to_location", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "device_to_location", + "entityType": "columns" + }, + { + "columns": [ + "device_id", + "location_id", + "time" + ], + "nameExplicit": false, + "name": "device_to_location_device_id_location_id_time_pk", + "schema": "public", + "table": "device_to_location", + "entityType": "pks" + }, + { + "nameExplicit": false, + "columns": [ + "device_id", + "location_id", + "time" + ], + "nullsNotDistinct": false, + "name": "device_to_location_device_id_location_id_time_unique", + "schema": "public", + "table": "device_to_location", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "device_to_location_device_id_device_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "device_to_location_location_id_location_id_fk", + "schema": "public", + "table": "device_to_location", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "measurement", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "timestamp (3) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "time", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location_id", + "schema": "public", + "table": "measurement", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "sensor_id", + "time" + ], + "nullsNotDistinct": false, + "name": "measurement_sensor_id_time_unique", + "schema": "public", + "table": "measurement", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "location_id" + ], + "schemaTo": "public", + "tableTo": "location", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "measurement_location_id_location_id_fk", + "schema": "public", + "table": "measurement", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "password", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "columns": [ + "user_id" + ], + "nameExplicit": false, + "name": "password_pkey", + "schema": "public", + "table": "password", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "password", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "password_user_id_user_id_fk", + "schema": "public", + "table": "password", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_pkey", + "schema": "public", + "table": "profile", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "display_name", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "home_latitude", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "home_longitude", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "real", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "10", + "generated": null, + "identity": null, + "name": "home_zoom", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "profile", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "nullsNotDistinct": false, + "name": "profile_user_id_unique", + "schema": "public", + "table": "profile", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_user_id_user_id_fk", + "schema": "public", + "table": "profile", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "profile_image", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "profile_image_pkey", + "schema": "public", + "table": "profile_image", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "alt_text", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content_type", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "bytea", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "blob", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "profile_id", + "schema": "public", + "table": "profile_image", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "profile_id" + ], + "schemaTo": "public", + "tableTo": "profile", + "columnsTo": [ + "id" + ], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "profile_image_profile_id_profile_id_fk", + "schema": "public", + "table": "profile_image", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "sensor", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "sensor_pkey", + "schema": "public", + "table": "sensor", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "icon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "status", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": "'inactive'", + "generated": null, + "identity": null, + "name": "status", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_type", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_phenomenon", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sensor_wiki_unit", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastMeasurement", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "data", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "order", + "schema": "public", + "table": "sensor", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "device_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "sensor_device_id_device_id_fk", + "schema": "public", + "table": "sensor", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "user", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "user_pkey", + "schema": "public", + "table": "user", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "unconfirmed_email", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "theme_preference", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": "'system'", + "generated": null, + "identity": null, + "name": "theme_preference", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'user'", + "generated": null, + "identity": null, + "name": "role", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'en_US'", + "generated": null, + "identity": null, + "name": "language", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "email_is_confirmed", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "newsletter_opt_in", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "accepted_tos_version_id", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "accepted_tos_at", + "schema": "public", + "table": "user", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "name" + ], + "nullsNotDistinct": false, + "name": "user_name_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "email" + ], + "nullsNotDistinct": false, + "name": "user_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "unconfirmed_email" + ], + "nullsNotDistinct": false, + "name": "user_unconfirmed_email_unique", + "schema": "public", + "table": "user", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": [ + "accepted_tos_version_id" + ], + "schemaTo": "public", + "tableTo": "tos_version", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "NO ACTION", + "name": "user_accepted_tos_version_id_tos_version_id_fk", + "schema": "public", + "table": "user", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "location", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "location_pkey", + "schema": "public", + "table": "location", + "entityType": "pks" + }, + { + "type": "bigserial", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "type": "geometry(point)", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location", + "schema": "public", + "table": "location", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "location" + ], + "nullsNotDistinct": false, + "name": "location_location_unique", + "schema": "public", + "table": "location", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "location", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "gist", + "concurrently": false, + "name": "location_index", + "schema": "public", + "table": "location", + "entityType": "indexes" + }, + { + "isRlsEnabled": false, + "name": "log_entry", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "log_entry_pkey", + "schema": "public", + "table": "log_entry", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "public", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "device_id", + "schema": "public", + "table": "log_entry", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "refresh_token", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "refresh_token", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "refresh_token_user_id_user_id_fk", + "schema": "public", + "table": "refresh_token", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "token_revocation", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hash", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "type": "json", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "token_revocation", + "entityType": "columns" + }, + { + "isRlsEnabled": false, + "name": "claim", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "claim_pkey", + "schema": "public", + "table": "claim", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "box_id", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "claim", + "entityType": "columns" + }, + { + "nameExplicit": true, + "columns": [ + "box_id" + ], + "nullsNotDistinct": false, + "name": "unique_box_id", + "schema": "public", + "table": "claim", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "expires_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "claim_expires_at_idx", + "schema": "public", + "table": "claim", + "entityType": "indexes" + }, + { + "nameExplicit": false, + "columns": [ + "box_id" + ], + "schemaTo": "public", + "tableTo": "device", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "claim_box_id_device_id_fk", + "schema": "public", + "table": "claim", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "integration", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "integration_pkey", + "schema": "public", + "table": "integration", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "slug", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "service_url", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "service_key", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "icon", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "order", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "integration", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "slug" + ], + "nullsNotDistinct": false, + "name": "integration_slug_unique", + "schema": "public", + "table": "integration", + "entityType": "uniques" + }, + { + "isRlsEnabled": false, + "name": "tos_user_state", + "schema": "public", + "entityType": "tables" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "tos_user_state", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "tos_version_id", + "schema": "public", + "table": "tos_user_state", + "entityType": "columns" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "accepted_at", + "schema": "public", + "table": "tos_user_state", + "entityType": "columns" + }, + { + "columns": [ + "user_id", + "tos_version_id" + ], + "nameExplicit": false, + "name": "tos_user_state_user_id_tos_version_id_pk", + "schema": "public", + "table": "tos_user_state", + "entityType": "pks" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "user_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "tos_user_state_user_idx", + "schema": "public", + "table": "tos_user_state", + "entityType": "indexes" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "tos_user_state_user_id_user_id_fk", + "schema": "public", + "table": "tos_user_state", + "entityType": "fks" + }, + { + "nameExplicit": false, + "columns": [ + "tos_version_id" + ], + "schemaTo": "public", + "tableTo": "tos_version", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "tos_user_state_tos_version_id_tos_version_id_fk", + "schema": "public", + "table": "tos_user_state", + "entityType": "fks" + }, + { + "isRlsEnabled": false, + "name": "tos_version", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "tos_version_pkey", + "schema": "public", + "table": "tos_version", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "version", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "body", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "effective_from", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "accept_by", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "created_at", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updated_at", + "schema": "public", + "table": "tos_version", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "version" + ], + "nullsNotDistinct": false, + "name": "tos_version_version_unique", + "schema": "public", + "table": "tos_version", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "effective_from", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "tos_version_effective_from_idx", + "schema": "public", + "table": "tos_version", + "entityType": "indexes" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "accept_by", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "tos_version_accept_by_idx", + "schema": "public", + "table": "tos_version", + "entityType": "indexes" + }, + { + "isRlsEnabled": false, + "name": "action_token", + "schema": "public", + "entityType": "tables" + }, + { + "columns": [ + "id" + ], + "nameExplicit": false, + "name": "action_token_pkey", + "schema": "public", + "table": "action_token", + "entityType": "pks" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "schema": "public", + "table": "action_token", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user_id", + "schema": "public", + "table": "action_token", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "purpose", + "schema": "public", + "table": "action_token", + "entityType": "columns" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token_hash", + "schema": "public", + "table": "action_token", + "entityType": "columns" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expires_at", + "schema": "public", + "table": "action_token", + "entityType": "columns" + }, + { + "nameExplicit": false, + "columns": [ + "token_hash" + ], + "nullsNotDistinct": false, + "name": "action_token_token_hash_unique", + "schema": "public", + "table": "action_token", + "entityType": "uniques" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "user_id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "purpose", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "action_token_user_purpose_uq", + "schema": "public", + "table": "action_token", + "entityType": "indexes" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "expires_at", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "action_token_expires_at_idx", + "schema": "public", + "table": "action_token", + "entityType": "indexes" + }, + { + "nameExplicit": false, + "columns": [ + "user_id" + ], + "schemaTo": "public", + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "action_token_user_id_user_id_fk", + "schema": "public", + "table": "action_token", + "entityType": "fks" + }, + { + "values": [ + "indoor", + "outdoor", + "mobile", + "unknown" + ], + "name": "exposure", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "homeV2Lora", + "homeV2Ethernet", + "homeV2Wifi", + "homeEthernet", + "homeWifi", + "homeEthernetFeinstaub", + "homeWifiFeinstaub", + "luftdaten_sds011", + "luftdaten_sds011_dht11", + "luftdaten_sds011_dht22", + "luftdaten_sds011_bmp180", + "luftdaten_sds011_bme280", + "hackair_home_v2", + "senseBox:Edu", + "luftdaten.info", + "custom" + ], + "name": "model", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "active", + "inactive", + "old" + ], + "name": "status", + "schema": "public", + "entityType": "enums" + }, + { + "values": [ + "light", + "dark", + "system" + ], + "name": "theme_preference", + "schema": "public", + "entityType": "enums" + } + ], + "renames": [] +} \ No newline at end of file diff --git a/app/db/drizzle/meta/0000_snapshot.json b/app/db/drizzle/meta/0000_snapshot.json deleted file mode 100644 index 607d8eacf..000000000 --- a/app/db/drizzle/meta/0000_snapshot.json +++ /dev/null @@ -1,501 +0,0 @@ -{ - "version": "7", - "dialect": "postgresql", - "tables": { - "public.device": { - "name": "device", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "use_auth": { - "name": "use_auth", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "exposure": { - "name": "exposure", - "type": "exposure", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "model": { - "name": "model", - "type": "model", - "primaryKey": false, - "notNull": false - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "latitude": { - "name": "latitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "longitude": { - "name": "longitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensorWikiModel": { - "name": "sensorWikiModel", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.measurement": { - "name": "measurement", - "schema": "", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "measurement_sensor_id_time_unique": { - "name": "measurement_sensor_id_time_unique", - "columns": [ - "sensor_id", - "time" - ], - "nullsNotDistinct": false - } - } - }, - "public.password": { - "name": "password", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "password_user_id_user_id_fk": { - "name": "password_user_id_user_id_fk", - "tableFrom": "password", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.profile": { - "name": "profile", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "username": { - "name": "username", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_user_id_user_id_fk": { - "name": "profile_user_id_user_id_fk", - "tableFrom": "profile", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "profile_username_unique": { - "name": "profile_username_unique", - "columns": [ - "username" - ], - "nullsNotDistinct": false - } - } - }, - "public.profile_image": { - "name": "profile_image", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "alt_text": { - "name": "alt_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "content_type": { - "name": "content_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "blob": { - "name": "blob", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "profile_id": { - "name": "profile_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_image_profile_id_profile_id_fk": { - "name": "profile_image_profile_id_profile_id_fk", - "tableFrom": "profile_image", - "columnsFrom": [ - "profile_id" - ], - "tableTo": "profile", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.sensor": { - "name": "sensor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_type": { - "name": "sensor_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensorWikiType": { - "name": "sensorWikiType", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensorWikiPhenomenon": { - "name": "sensorWikiPhenomenon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensorWikiUnit": { - "name": "sensorWikiUnit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "lastMeasurement": { - "name": "lastMeasurement", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "data": { - "name": "data", - "type": "json", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'user'" - }, - "language": { - "name": "language", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'en_US'" - }, - "emailIsConfirmed": { - "name": "emailIsConfirmed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "user_email_unique": { - "name": "user_email_unique", - "columns": [ - "email" - ], - "nullsNotDistinct": false - } - } - } - }, - "enums": { - "public.model": { - "name": "model", - "schema": "public", - "values": [ - "HOME_V2_LORA" - ] - }, - "public.exposure": { - "name": "exposure", - "schema": "public", - "values": [ - "indoor", - "outdoor", - "mobile", - "unknown" - ] - }, - "public.status": { - "name": "status", - "schema": "public", - "values": [ - "active", - "inactive", - "old" - ] - } - }, - "schemas": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "id": "b24d2bce-0eeb-4d58-a082-5a6b1e4af4b2", - "prevId": "00000000-0000-0000-0000-000000000000" -} \ No newline at end of file diff --git a/app/db/drizzle/meta/0001_snapshot.json b/app/db/drizzle/meta/0001_snapshot.json deleted file mode 100644 index f97b685bd..000000000 --- a/app/db/drizzle/meta/0001_snapshot.json +++ /dev/null @@ -1,501 +0,0 @@ -{ - "version": "7", - "dialect": "postgresql", - "tables": { - "public.device": { - "name": "device", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "use_auth": { - "name": "use_auth", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "exposure": { - "name": "exposure", - "type": "exposure", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "model": { - "name": "model", - "type": "model", - "primaryKey": false, - "notNull": false - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "latitude": { - "name": "latitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "longitude": { - "name": "longitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensorWikiModel": { - "name": "sensorWikiModel", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.measurement": { - "name": "measurement", - "schema": "", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "measurement_sensor_id_time_unique": { - "name": "measurement_sensor_id_time_unique", - "columns": [ - "sensor_id", - "time" - ], - "nullsNotDistinct": false - } - } - }, - "public.password": { - "name": "password", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "password_user_id_user_id_fk": { - "name": "password_user_id_user_id_fk", - "tableFrom": "password", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.profile": { - "name": "profile", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "username": { - "name": "username", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_user_id_user_id_fk": { - "name": "profile_user_id_user_id_fk", - "tableFrom": "profile", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "profile_username_unique": { - "name": "profile_username_unique", - "columns": [ - "username" - ], - "nullsNotDistinct": false - } - } - }, - "public.profile_image": { - "name": "profile_image", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "alt_text": { - "name": "alt_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "content_type": { - "name": "content_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "blob": { - "name": "blob", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "profile_id": { - "name": "profile_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_image_profile_id_profile_id_fk": { - "name": "profile_image_profile_id_profile_id_fk", - "tableFrom": "profile_image", - "columnsFrom": [ - "profile_id" - ], - "tableTo": "profile", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.sensor": { - "name": "sensor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_type": { - "name": "sensor_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensorWikiType": { - "name": "sensorWikiType", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensorWikiPhenomenon": { - "name": "sensorWikiPhenomenon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensorWikiUnit": { - "name": "sensorWikiUnit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "lastMeasurement": { - "name": "lastMeasurement", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "data": { - "name": "data", - "type": "json", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'user'" - }, - "language": { - "name": "language", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'en_US'" - }, - "emailIsConfirmed": { - "name": "emailIsConfirmed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "user_email_unique": { - "name": "user_email_unique", - "columns": [ - "email" - ], - "nullsNotDistinct": false - } - } - } - }, - "enums": { - "public.model": { - "name": "model", - "schema": "public", - "values": [ - "HOME_V2_LORA" - ] - }, - "public.exposure": { - "name": "exposure", - "schema": "public", - "values": [ - "indoor", - "outdoor", - "mobile", - "unknown" - ] - }, - "public.status": { - "name": "status", - "schema": "public", - "values": [ - "active", - "inactive", - "old" - ] - } - }, - "schemas": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "id": "67d8dfcf-df55-49e7-8ab7-eadb52bb1772", - "prevId": "b24d2bce-0eeb-4d58-a082-5a6b1e4af4b2" -} \ No newline at end of file diff --git a/app/db/drizzle/meta/0002_snapshot.json b/app/db/drizzle/meta/0002_snapshot.json deleted file mode 100644 index 744e34efb..000000000 --- a/app/db/drizzle/meta/0002_snapshot.json +++ /dev/null @@ -1,501 +0,0 @@ -{ - "version": "7", - "dialect": "postgresql", - "tables": { - "public.device": { - "name": "device", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "use_auth": { - "name": "use_auth", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "exposure": { - "name": "exposure", - "type": "exposure", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "model": { - "name": "model", - "type": "model", - "primaryKey": false, - "notNull": false - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "latitude": { - "name": "latitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "longitude": { - "name": "longitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensorWikiModel": { - "name": "sensorWikiModel", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.measurement": { - "name": "measurement", - "schema": "", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "measurement_sensor_id_time_unique": { - "name": "measurement_sensor_id_time_unique", - "columns": [ - "sensor_id", - "time" - ], - "nullsNotDistinct": false - } - } - }, - "public.password": { - "name": "password", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "password_user_id_user_id_fk": { - "name": "password_user_id_user_id_fk", - "tableFrom": "password", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.profile": { - "name": "profile", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "username": { - "name": "username", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_user_id_user_id_fk": { - "name": "profile_user_id_user_id_fk", - "tableFrom": "profile", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "profile_username_unique": { - "name": "profile_username_unique", - "columns": [ - "username" - ], - "nullsNotDistinct": false - } - } - }, - "public.profile_image": { - "name": "profile_image", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "alt_text": { - "name": "alt_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "content_type": { - "name": "content_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "blob": { - "name": "blob", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "profile_id": { - "name": "profile_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_image_profile_id_profile_id_fk": { - "name": "profile_image_profile_id_profile_id_fk", - "tableFrom": "profile_image", - "columnsFrom": [ - "profile_id" - ], - "tableTo": "profile", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.sensor": { - "name": "sensor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_type": { - "name": "sensor_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensorWikiType": { - "name": "sensorWikiType", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensorWikiPhenomenon": { - "name": "sensorWikiPhenomenon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensorWikiUnit": { - "name": "sensorWikiUnit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "lastMeasurement": { - "name": "lastMeasurement", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "data": { - "name": "data", - "type": "json", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'user'" - }, - "language": { - "name": "language", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'en_US'" - }, - "emailIsConfirmed": { - "name": "emailIsConfirmed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "user_email_unique": { - "name": "user_email_unique", - "columns": [ - "email" - ], - "nullsNotDistinct": false - } - } - } - }, - "enums": { - "public.model": { - "name": "model", - "schema": "public", - "values": [ - "HOME_V2_LORA" - ] - }, - "public.exposure": { - "name": "exposure", - "schema": "public", - "values": [ - "indoor", - "outdoor", - "mobile", - "unknown" - ] - }, - "public.status": { - "name": "status", - "schema": "public", - "values": [ - "active", - "inactive", - "old" - ] - } - }, - "schemas": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "id": "04d81e70-5422-45b0-9a9d-3a75736a2f43", - "prevId": "67d8dfcf-df55-49e7-8ab7-eadb52bb1772" -} \ No newline at end of file diff --git a/app/db/drizzle/meta/0003_snapshot.json b/app/db/drizzle/meta/0003_snapshot.json deleted file mode 100644 index 2bedeee15..000000000 --- a/app/db/drizzle/meta/0003_snapshot.json +++ /dev/null @@ -1,501 +0,0 @@ -{ - "version": "7", - "dialect": "postgresql", - "tables": { - "public.device": { - "name": "device", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "use_auth": { - "name": "use_auth", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "exposure": { - "name": "exposure", - "type": "exposure", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "model": { - "name": "model", - "type": "model", - "primaryKey": false, - "notNull": false - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "latitude": { - "name": "latitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "longitude": { - "name": "longitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensorWikiModel": { - "name": "sensorWikiModel", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.measurement": { - "name": "measurement", - "schema": "", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "measurement_sensor_id_time_unique": { - "name": "measurement_sensor_id_time_unique", - "columns": [ - "sensor_id", - "time" - ], - "nullsNotDistinct": false - } - } - }, - "public.password": { - "name": "password", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "password_user_id_user_id_fk": { - "name": "password_user_id_user_id_fk", - "tableFrom": "password", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.profile": { - "name": "profile", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "username": { - "name": "username", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_user_id_user_id_fk": { - "name": "profile_user_id_user_id_fk", - "tableFrom": "profile", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "profile_username_unique": { - "name": "profile_username_unique", - "columns": [ - "username" - ], - "nullsNotDistinct": false - } - } - }, - "public.profile_image": { - "name": "profile_image", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "alt_text": { - "name": "alt_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "content_type": { - "name": "content_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "blob": { - "name": "blob", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "profile_id": { - "name": "profile_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_image_profile_id_profile_id_fk": { - "name": "profile_image_profile_id_profile_id_fk", - "tableFrom": "profile_image", - "columnsFrom": [ - "profile_id" - ], - "tableTo": "profile", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.sensor": { - "name": "sensor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_type": { - "name": "sensor_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensorWikiType": { - "name": "sensorWikiType", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensorWikiPhenomenon": { - "name": "sensorWikiPhenomenon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensorWikiUnit": { - "name": "sensorWikiUnit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "lastMeasurement": { - "name": "lastMeasurement", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "data": { - "name": "data", - "type": "json", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'user'" - }, - "language": { - "name": "language", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'en_US'" - }, - "emailIsConfirmed": { - "name": "emailIsConfirmed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "user_email_unique": { - "name": "user_email_unique", - "columns": [ - "email" - ], - "nullsNotDistinct": false - } - } - } - }, - "enums": { - "public.model": { - "name": "model", - "schema": "public", - "values": [ - "HOME_V2_LORA" - ] - }, - "public.exposure": { - "name": "exposure", - "schema": "public", - "values": [ - "indoor", - "outdoor", - "mobile", - "unknown" - ] - }, - "public.status": { - "name": "status", - "schema": "public", - "values": [ - "active", - "inactive", - "old" - ] - } - }, - "schemas": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "id": "dca7d463-f950-4c72-bf96-1a6eaae5cf8b", - "prevId": "04d81e70-5422-45b0-9a9d-3a75736a2f43" -} \ No newline at end of file diff --git a/app/db/drizzle/meta/0004_snapshot.json b/app/db/drizzle/meta/0004_snapshot.json deleted file mode 100644 index 4f2b2356b..000000000 --- a/app/db/drizzle/meta/0004_snapshot.json +++ /dev/null @@ -1,501 +0,0 @@ -{ - "version": "7", - "dialect": "postgresql", - "tables": { - "public.device": { - "name": "device", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "use_auth": { - "name": "use_auth", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "exposure": { - "name": "exposure", - "type": "exposure", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "model": { - "name": "model", - "type": "model", - "primaryKey": false, - "notNull": false - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "latitude": { - "name": "latitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "longitude": { - "name": "longitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensorWikiModel": { - "name": "sensorWikiModel", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.measurement": { - "name": "measurement", - "schema": "", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "measurement_sensor_id_time_unique": { - "name": "measurement_sensor_id_time_unique", - "columns": [ - "sensor_id", - "time" - ], - "nullsNotDistinct": false - } - } - }, - "public.password": { - "name": "password", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "password_user_id_user_id_fk": { - "name": "password_user_id_user_id_fk", - "tableFrom": "password", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.profile": { - "name": "profile", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "username": { - "name": "username", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_user_id_user_id_fk": { - "name": "profile_user_id_user_id_fk", - "tableFrom": "profile", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "profile_username_unique": { - "name": "profile_username_unique", - "columns": [ - "username" - ], - "nullsNotDistinct": false - } - } - }, - "public.profile_image": { - "name": "profile_image", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "alt_text": { - "name": "alt_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "content_type": { - "name": "content_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "blob": { - "name": "blob", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "profile_id": { - "name": "profile_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_image_profile_id_profile_id_fk": { - "name": "profile_image_profile_id_profile_id_fk", - "tableFrom": "profile_image", - "columnsFrom": [ - "profile_id" - ], - "tableTo": "profile", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.sensor": { - "name": "sensor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_type": { - "name": "sensor_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensorWikiType": { - "name": "sensorWikiType", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensorWikiPhenomenon": { - "name": "sensorWikiPhenomenon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensorWikiUnit": { - "name": "sensorWikiUnit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "lastMeasurement": { - "name": "lastMeasurement", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "data": { - "name": "data", - "type": "json", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'user'" - }, - "language": { - "name": "language", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'en_US'" - }, - "email_is_confirmed": { - "name": "email_is_confirmed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "user_email_unique": { - "name": "user_email_unique", - "columns": [ - "email" - ], - "nullsNotDistinct": false - } - } - } - }, - "enums": { - "public.model": { - "name": "model", - "schema": "public", - "values": [ - "HOME_V2_LORA" - ] - }, - "public.exposure": { - "name": "exposure", - "schema": "public", - "values": [ - "indoor", - "outdoor", - "mobile", - "unknown" - ] - }, - "public.status": { - "name": "status", - "schema": "public", - "values": [ - "active", - "inactive", - "old" - ] - } - }, - "schemas": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "id": "de8c44e3-3ed9-4ae4-b6d7-c21287899766", - "prevId": "dca7d463-f950-4c72-bf96-1a6eaae5cf8b" -} \ No newline at end of file diff --git a/app/db/drizzle/meta/0005_snapshot.json b/app/db/drizzle/meta/0005_snapshot.json deleted file mode 100644 index 695a00d1a..000000000 --- a/app/db/drizzle/meta/0005_snapshot.json +++ /dev/null @@ -1,501 +0,0 @@ -{ - "version": "7", - "dialect": "postgresql", - "tables": { - "public.device": { - "name": "device", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "use_auth": { - "name": "use_auth", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "exposure": { - "name": "exposure", - "type": "exposure", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "model": { - "name": "model", - "type": "model", - "primaryKey": false, - "notNull": false - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "latitude": { - "name": "latitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "longitude": { - "name": "longitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_model": { - "name": "sensor_wiki_model", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.measurement": { - "name": "measurement", - "schema": "", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "measurement_sensor_id_time_unique": { - "name": "measurement_sensor_id_time_unique", - "columns": [ - "sensor_id", - "time" - ], - "nullsNotDistinct": false - } - } - }, - "public.password": { - "name": "password", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "password_user_id_user_id_fk": { - "name": "password_user_id_user_id_fk", - "tableFrom": "password", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.profile": { - "name": "profile", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "username": { - "name": "username", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_user_id_user_id_fk": { - "name": "profile_user_id_user_id_fk", - "tableFrom": "profile", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "profile_username_unique": { - "name": "profile_username_unique", - "columns": [ - "username" - ], - "nullsNotDistinct": false - } - } - }, - "public.profile_image": { - "name": "profile_image", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "alt_text": { - "name": "alt_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "content_type": { - "name": "content_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "blob": { - "name": "blob", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "profile_id": { - "name": "profile_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_image_profile_id_profile_id_fk": { - "name": "profile_image_profile_id_profile_id_fk", - "tableFrom": "profile_image", - "columnsFrom": [ - "profile_id" - ], - "tableTo": "profile", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.sensor": { - "name": "sensor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_type": { - "name": "sensor_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_type": { - "name": "sensor_wiki_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_phenomenon": { - "name": "sensor_wiki_phenomenon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_unit": { - "name": "sensor_wiki_unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "lastMeasurement": { - "name": "lastMeasurement", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "data": { - "name": "data", - "type": "json", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'user'" - }, - "language": { - "name": "language", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'en_US'" - }, - "email_is_confirmed": { - "name": "email_is_confirmed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "user_email_unique": { - "name": "user_email_unique", - "columns": [ - "email" - ], - "nullsNotDistinct": false - } - } - } - }, - "enums": { - "public.model": { - "name": "model", - "schema": "public", - "values": [ - "HOME_V2_LORA" - ] - }, - "public.exposure": { - "name": "exposure", - "schema": "public", - "values": [ - "indoor", - "outdoor", - "mobile", - "unknown" - ] - }, - "public.status": { - "name": "status", - "schema": "public", - "values": [ - "active", - "inactive", - "old" - ] - } - }, - "schemas": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "id": "66ddf798-abd6-4995-a84f-3387f98c7f1b", - "prevId": "de8c44e3-3ed9-4ae4-b6d7-c21287899766" -} \ No newline at end of file diff --git a/app/db/drizzle/meta/0006_snapshot.json b/app/db/drizzle/meta/0006_snapshot.json deleted file mode 100644 index 65fe1aa2f..000000000 --- a/app/db/drizzle/meta/0006_snapshot.json +++ /dev/null @@ -1,518 +0,0 @@ -{ - "id": "4f95bd7f-baee-4231-9a04-f2f7ed07ee59", - "prevId": "66ddf798-abd6-4995-a84f-3387f98c7f1b", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.device": { - "name": "device", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "link": { - "name": "link", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "use_auth": { - "name": "use_auth", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "exposure": { - "name": "exposure", - "type": "exposure", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "model": { - "name": "model", - "type": "model", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "latitude": { - "name": "latitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "longitude": { - "name": "longitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_model": { - "name": "sensor_wiki_model", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.measurement": { - "name": "measurement", - "schema": "", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "measurement_sensor_id_time_unique": { - "name": "measurement_sensor_id_time_unique", - "nullsNotDistinct": false, - "columns": [ - "sensor_id", - "time" - ] - } - } - }, - "public.password": { - "name": "password", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "password_user_id_user_id_fk": { - "name": "password_user_id_user_id_fk", - "tableFrom": "password", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.profile": { - "name": "profile", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "username": { - "name": "username", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_user_id_user_id_fk": { - "name": "profile_user_id_user_id_fk", - "tableFrom": "profile", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "profile_username_unique": { - "name": "profile_username_unique", - "nullsNotDistinct": false, - "columns": [ - "username" - ] - } - } - }, - "public.profile_image": { - "name": "profile_image", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "alt_text": { - "name": "alt_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "content_type": { - "name": "content_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "blob": { - "name": "blob", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "profile_id": { - "name": "profile_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_image_profile_id_profile_id_fk": { - "name": "profile_image_profile_id_profile_id_fk", - "tableFrom": "profile_image", - "tableTo": "profile", - "columnsFrom": [ - "profile_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.sensor": { - "name": "sensor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_type": { - "name": "sensor_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_type": { - "name": "sensor_wiki_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_phenomenon": { - "name": "sensor_wiki_phenomenon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_unit": { - "name": "sensor_wiki_unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "lastMeasurement": { - "name": "lastMeasurement", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "data": { - "name": "data", - "type": "json", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'user'" - }, - "language": { - "name": "language", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'en_US'" - }, - "email_is_confirmed": { - "name": "email_is_confirmed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "user_email_unique": { - "name": "user_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - } - } - }, - "enums": { - "public.model": { - "name": "model", - "schema": "public", - "values": [ - "HOME_V2_LORA" - ] - }, - "public.exposure": { - "name": "exposure", - "schema": "public", - "values": [ - "indoor", - "outdoor", - "mobile", - "unknown" - ] - }, - "public.status": { - "name": "status", - "schema": "public", - "values": [ - "active", - "inactive", - "old" - ] - } - }, - "schemas": {}, - "sequences": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/app/db/drizzle/meta/0007_snapshot.json b/app/db/drizzle/meta/0007_snapshot.json deleted file mode 100644 index 4dd9485d6..000000000 --- a/app/db/drizzle/meta/0007_snapshot.json +++ /dev/null @@ -1,560 +0,0 @@ -{ - "id": "eabfb0f4-714a-41fc-ad8a-bfbd7149e2b0", - "prevId": "4f95bd7f-baee-4231-9a04-f2f7ed07ee59", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.device": { - "name": "device", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "link": { - "name": "link", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "use_auth": { - "name": "use_auth", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "exposure": { - "name": "exposure", - "type": "exposure", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "model": { - "name": "model", - "type": "model", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "latitude": { - "name": "latitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "longitude": { - "name": "longitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_model": { - "name": "sensor_wiki_model", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.measurement": { - "name": "measurement", - "schema": "", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "measurement_sensor_id_time_unique": { - "name": "measurement_sensor_id_time_unique", - "nullsNotDistinct": false, - "columns": [ - "sensor_id", - "time" - ] - } - } - }, - "public.password": { - "name": "password", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "password_user_id_user_id_fk": { - "name": "password_user_id_user_id_fk", - "tableFrom": "password", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.profile": { - "name": "profile", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "username": { - "name": "username", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_user_id_user_id_fk": { - "name": "profile_user_id_user_id_fk", - "tableFrom": "profile", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "profile_username_unique": { - "name": "profile_username_unique", - "nullsNotDistinct": false, - "columns": [ - "username" - ] - } - } - }, - "public.profile_image": { - "name": "profile_image", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "alt_text": { - "name": "alt_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "content_type": { - "name": "content_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "blob": { - "name": "blob", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "profile_id": { - "name": "profile_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_image_profile_id_profile_id_fk": { - "name": "profile_image_profile_id_profile_id_fk", - "tableFrom": "profile_image", - "tableTo": "profile", - "columnsFrom": [ - "profile_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.sensor": { - "name": "sensor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_type": { - "name": "sensor_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_type": { - "name": "sensor_wiki_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_phenomenon": { - "name": "sensor_wiki_phenomenon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_unit": { - "name": "sensor_wiki_unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "lastMeasurement": { - "name": "lastMeasurement", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "data": { - "name": "data", - "type": "json", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'user'" - }, - "language": { - "name": "language", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'en_US'" - }, - "email_is_confirmed": { - "name": "email_is_confirmed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "user_email_unique": { - "name": "user_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - } - }, - "public.log_entry": { - "name": "log_entry", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - } - }, - "enums": { - "public.exposure": { - "name": "exposure", - "schema": "public", - "values": [ - "indoor", - "outdoor", - "mobile", - "unknown" - ] - }, - "public.model": { - "name": "model", - "schema": "public", - "values": [ - "HOME_V2_LORA" - ] - }, - "public.status": { - "name": "status", - "schema": "public", - "values": [ - "active", - "inactive", - "old" - ] - } - }, - "schemas": {}, - "sequences": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/app/db/drizzle/meta/0008_snapshot.json b/app/db/drizzle/meta/0008_snapshot.json deleted file mode 100644 index cd9e41e96..000000000 --- a/app/db/drizzle/meta/0008_snapshot.json +++ /dev/null @@ -1,567 +0,0 @@ -{ - "id": "109b9611-48ac-4cd7-8003-9bb880e663a5", - "prevId": "eabfb0f4-714a-41fc-ad8a-bfbd7149e2b0", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.device": { - "name": "device", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tags": { - "name": "tags", - "type": "text[]", - "primaryKey": false, - "notNull": false, - "default": "ARRAY[]::text[]" - }, - "link": { - "name": "link", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "use_auth": { - "name": "use_auth", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "exposure": { - "name": "exposure", - "type": "exposure", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "model": { - "name": "model", - "type": "model", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "latitude": { - "name": "latitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "longitude": { - "name": "longitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_model": { - "name": "sensor_wiki_model", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.measurement": { - "name": "measurement", - "schema": "", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "measurement_sensor_id_time_unique": { - "name": "measurement_sensor_id_time_unique", - "nullsNotDistinct": false, - "columns": [ - "sensor_id", - "time" - ] - } - } - }, - "public.password": { - "name": "password", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "password_user_id_user_id_fk": { - "name": "password_user_id_user_id_fk", - "tableFrom": "password", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.profile": { - "name": "profile", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "username": { - "name": "username", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_user_id_user_id_fk": { - "name": "profile_user_id_user_id_fk", - "tableFrom": "profile", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "profile_username_unique": { - "name": "profile_username_unique", - "nullsNotDistinct": false, - "columns": [ - "username" - ] - } - } - }, - "public.profile_image": { - "name": "profile_image", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "alt_text": { - "name": "alt_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "content_type": { - "name": "content_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "blob": { - "name": "blob", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "profile_id": { - "name": "profile_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_image_profile_id_profile_id_fk": { - "name": "profile_image_profile_id_profile_id_fk", - "tableFrom": "profile_image", - "tableTo": "profile", - "columnsFrom": [ - "profile_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.sensor": { - "name": "sensor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_type": { - "name": "sensor_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_type": { - "name": "sensor_wiki_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_phenomenon": { - "name": "sensor_wiki_phenomenon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_unit": { - "name": "sensor_wiki_unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "lastMeasurement": { - "name": "lastMeasurement", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "data": { - "name": "data", - "type": "json", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'user'" - }, - "language": { - "name": "language", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'en_US'" - }, - "email_is_confirmed": { - "name": "email_is_confirmed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "user_email_unique": { - "name": "user_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - } - }, - "public.log_entry": { - "name": "log_entry", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - } - }, - "enums": { - "public.exposure": { - "name": "exposure", - "schema": "public", - "values": [ - "indoor", - "outdoor", - "mobile", - "unknown" - ] - }, - "public.model": { - "name": "model", - "schema": "public", - "values": [ - "HOME_V2_LORA" - ] - }, - "public.status": { - "name": "status", - "schema": "public", - "values": [ - "active", - "inactive", - "old" - ] - } - }, - "schemas": {}, - "sequences": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/app/db/drizzle/meta/0009_snapshot.json b/app/db/drizzle/meta/0009_snapshot.json deleted file mode 100644 index 8cc783c54..000000000 --- a/app/db/drizzle/meta/0009_snapshot.json +++ /dev/null @@ -1,567 +0,0 @@ -{ - "id": "ac6a9359-cfa1-4edc-87ac-7a94ddde7b1c", - "prevId": "109b9611-48ac-4cd7-8003-9bb880e663a5", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.device": { - "name": "device", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tags": { - "name": "tags", - "type": "text[]", - "primaryKey": false, - "notNull": false, - "default": "ARRAY[]::text[]" - }, - "link": { - "name": "link", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "use_auth": { - "name": "use_auth", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "exposure": { - "name": "exposure", - "type": "exposure", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "model": { - "name": "model", - "type": "model", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "latitude": { - "name": "latitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "longitude": { - "name": "longitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_model": { - "name": "sensor_wiki_model", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.measurement": { - "name": "measurement", - "schema": "", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "measurement_sensor_id_time_unique": { - "name": "measurement_sensor_id_time_unique", - "columns": [ - "sensor_id", - "time" - ], - "nullsNotDistinct": false - } - } - }, - "public.password": { - "name": "password", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "password_user_id_user_id_fk": { - "name": "password_user_id_user_id_fk", - "tableFrom": "password", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.profile": { - "name": "profile", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "username": { - "name": "username", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_user_id_user_id_fk": { - "name": "profile_user_id_user_id_fk", - "tableFrom": "profile", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "profile_username_unique": { - "name": "profile_username_unique", - "columns": [ - "username" - ], - "nullsNotDistinct": false - } - } - }, - "public.profile_image": { - "name": "profile_image", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "alt_text": { - "name": "alt_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "content_type": { - "name": "content_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "blob": { - "name": "blob", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "profile_id": { - "name": "profile_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_image_profile_id_profile_id_fk": { - "name": "profile_image_profile_id_profile_id_fk", - "tableFrom": "profile_image", - "columnsFrom": [ - "profile_id" - ], - "tableTo": "profile", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.sensor": { - "name": "sensor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_type": { - "name": "sensor_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_type": { - "name": "sensor_wiki_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_phenomenon": { - "name": "sensor_wiki_phenomenon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_unit": { - "name": "sensor_wiki_unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "lastMeasurement": { - "name": "lastMeasurement", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "data": { - "name": "data", - "type": "json", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'user'" - }, - "language": { - "name": "language", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'en_US'" - }, - "email_is_confirmed": { - "name": "email_is_confirmed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "user_email_unique": { - "name": "user_email_unique", - "columns": [ - "email" - ], - "nullsNotDistinct": false - } - } - }, - "public.log_entry": { - "name": "log_entry", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - } - }, - "enums": { - "public.exposure": { - "name": "exposure", - "schema": "public", - "values": [ - "indoor", - "outdoor", - "mobile", - "unknown" - ] - }, - "public.model": { - "name": "model", - "schema": "public", - "values": [ - "HOME_V2_LORA" - ] - }, - "public.status": { - "name": "status", - "schema": "public", - "values": [ - "active", - "inactive", - "old" - ] - } - }, - "schemas": {}, - "sequences": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/app/db/drizzle/meta/0010_snapshot.json b/app/db/drizzle/meta/0010_snapshot.json deleted file mode 100644 index bf7cca150..000000000 --- a/app/db/drizzle/meta/0010_snapshot.json +++ /dev/null @@ -1,708 +0,0 @@ -{ - "id": "7286a667-b707-4367-85d4-6406c69e402f", - "prevId": "ac6a9359-cfa1-4edc-87ac-7a94ddde7b1c", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.device": { - "name": "device", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tags": { - "name": "tags", - "type": "text[]", - "primaryKey": false, - "notNull": false, - "default": "ARRAY[]::text[]" - }, - "link": { - "name": "link", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "use_auth": { - "name": "use_auth", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "exposure": { - "name": "exposure", - "type": "exposure", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "model": { - "name": "model", - "type": "model", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "latitude": { - "name": "latitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "longitude": { - "name": "longitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_model": { - "name": "sensor_wiki_model", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.device_to_location": { - "name": "device_to_location", - "schema": "", - "columns": { - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "location_id": { - "name": "location_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "device_to_location_device_id_device_id_fk": { - "name": "device_to_location_device_id_device_id_fk", - "tableFrom": "device_to_location", - "tableTo": "device", - "columnsFrom": [ - "device_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "device_to_location_location_id_location_id_fk": { - "name": "device_to_location_location_id_location_id_fk", - "tableFrom": "device_to_location", - "tableTo": "location", - "columnsFrom": [ - "location_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "device_to_location_device_id_location_id_time_pk": { - "name": "device_to_location_device_id_location_id_time_pk", - "columns": [ - "device_id", - "location_id", - "time" - ] - } - }, - "uniqueConstraints": { - "device_to_location_device_id_location_id_time_unique": { - "name": "device_to_location_device_id_location_id_time_unique", - "nullsNotDistinct": false, - "columns": [ - "device_id", - "location_id", - "time" - ] - } - } - }, - "public.measurement": { - "name": "measurement", - "schema": "", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "location_id": { - "name": "location_id", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "measurement_location_id_location_id_fk": { - "name": "measurement_location_id_location_id_fk", - "tableFrom": "measurement", - "tableTo": "location", - "columnsFrom": [ - "location_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "measurement_sensor_id_time_unique": { - "name": "measurement_sensor_id_time_unique", - "nullsNotDistinct": false, - "columns": [ - "sensor_id", - "time" - ] - } - } - }, - "public.password": { - "name": "password", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "password_user_id_user_id_fk": { - "name": "password_user_id_user_id_fk", - "tableFrom": "password", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.profile": { - "name": "profile", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "username": { - "name": "username", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_user_id_user_id_fk": { - "name": "profile_user_id_user_id_fk", - "tableFrom": "profile", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "profile_username_unique": { - "name": "profile_username_unique", - "nullsNotDistinct": false, - "columns": [ - "username" - ] - } - } - }, - "public.profile_image": { - "name": "profile_image", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "alt_text": { - "name": "alt_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "content_type": { - "name": "content_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "blob": { - "name": "blob", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "profile_id": { - "name": "profile_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_image_profile_id_profile_id_fk": { - "name": "profile_image_profile_id_profile_id_fk", - "tableFrom": "profile_image", - "tableTo": "profile", - "columnsFrom": [ - "profile_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.sensor": { - "name": "sensor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_type": { - "name": "sensor_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_type": { - "name": "sensor_wiki_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_phenomenon": { - "name": "sensor_wiki_phenomenon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_unit": { - "name": "sensor_wiki_unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "lastMeasurement": { - "name": "lastMeasurement", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "data": { - "name": "data", - "type": "json", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'user'" - }, - "language": { - "name": "language", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'en_US'" - }, - "email_is_confirmed": { - "name": "email_is_confirmed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "user_email_unique": { - "name": "user_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - } - }, - "public.location": { - "name": "location", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "location": { - "name": "location", - "type": "geometry(point)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "location_index": { - "name": "location_index", - "columns": [ - { - "expression": "location", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "location_location_unique": { - "name": "location_location_unique", - "nullsNotDistinct": false, - "columns": [ - "location" - ] - } - } - }, - "public.log_entry": { - "name": "log_entry", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - } - }, - "enums": { - "public.exposure": { - "name": "exposure", - "schema": "public", - "values": [ - "indoor", - "outdoor", - "mobile", - "unknown" - ] - }, - "public.model": { - "name": "model", - "schema": "public", - "values": [ - "HOME_V2_LORA" - ] - }, - "public.status": { - "name": "status", - "schema": "public", - "values": [ - "active", - "inactive", - "old" - ] - } - }, - "schemas": {}, - "sequences": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/app/db/drizzle/meta/0011_snapshot.json b/app/db/drizzle/meta/0011_snapshot.json deleted file mode 100644 index 42f98d41c..000000000 --- a/app/db/drizzle/meta/0011_snapshot.json +++ /dev/null @@ -1,962 +0,0 @@ -{ - "id": "9547c380-88da-4d27-a2e5-9f07c0a554d0", - "prevId": "7286a667-b707-4367-85d4-6406c69e402f", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.device": { - "name": "device", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tags": { - "name": "tags", - "type": "text[]", - "primaryKey": false, - "notNull": false, - "default": "ARRAY[]::text[]" - }, - "link": { - "name": "link", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "use_auth": { - "name": "use_auth", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "exposure": { - "name": "exposure", - "type": "exposure", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "model": { - "name": "model", - "type": "model", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "latitude": { - "name": "latitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "longitude": { - "name": "longitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_model": { - "name": "sensor_wiki_model", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.device_to_location": { - "name": "device_to_location", - "schema": "", - "columns": { - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "location_id": { - "name": "location_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "device_to_location_device_id_device_id_fk": { - "name": "device_to_location_device_id_device_id_fk", - "tableFrom": "device_to_location", - "tableTo": "device", - "columnsFrom": [ - "device_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - }, - "device_to_location_location_id_location_id_fk": { - "name": "device_to_location_location_id_location_id_fk", - "tableFrom": "device_to_location", - "tableTo": "location", - "columnsFrom": [ - "location_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "device_to_location_device_id_location_id_time_pk": { - "name": "device_to_location_device_id_location_id_time_pk", - "columns": [ - "device_id", - "location_id", - "time" - ] - } - }, - "uniqueConstraints": { - "device_to_location_device_id_location_id_time_unique": { - "name": "device_to_location_device_id_location_id_time_unique", - "nullsNotDistinct": false, - "columns": [ - "device_id", - "location_id", - "time" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.measurement": { - "name": "measurement", - "schema": "", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "location_id": { - "name": "location_id", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "measurement_location_id_location_id_fk": { - "name": "measurement_location_id_location_id_fk", - "tableFrom": "measurement", - "tableTo": "location", - "columnsFrom": [ - "location_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "measurement_sensor_id_time_unique": { - "name": "measurement_sensor_id_time_unique", - "nullsNotDistinct": false, - "columns": [ - "sensor_id", - "time" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.password": { - "name": "password", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "password_user_id_user_id_fk": { - "name": "password_user_id_user_id_fk", - "tableFrom": "password", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile": { - "name": "profile", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "username": { - "name": "username", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_user_id_user_id_fk": { - "name": "profile_user_id_user_id_fk", - "tableFrom": "profile", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "profile_username_unique": { - "name": "profile_username_unique", - "nullsNotDistinct": false, - "columns": [ - "username" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile_image": { - "name": "profile_image", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "alt_text": { - "name": "alt_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "content_type": { - "name": "content_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "blob": { - "name": "blob", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "profile_id": { - "name": "profile_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_image_profile_id_profile_id_fk": { - "name": "profile_image_profile_id_profile_id_fk", - "tableFrom": "profile_image", - "tableTo": "profile", - "columnsFrom": [ - "profile_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.sensor": { - "name": "sensor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_type": { - "name": "sensor_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_type": { - "name": "sensor_wiki_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_phenomenon": { - "name": "sensor_wiki_phenomenon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_unit": { - "name": "sensor_wiki_unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "lastMeasurement": { - "name": "lastMeasurement", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "data": { - "name": "data", - "type": "json", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'user'" - }, - "language": { - "name": "language", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'en_US'" - }, - "email_is_confirmed": { - "name": "email_is_confirmed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "user_email_unique": { - "name": "user_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.location": { - "name": "location", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "location": { - "name": "location", - "type": "geometry(point)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "location_index": { - "name": "location_index", - "columns": [ - { - "expression": "location", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "location_location_unique": { - "name": "location_location_unique", - "nullsNotDistinct": false, - "columns": [ - "location" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.log_entry": { - "name": "log_entry", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "public.exposure": { - "name": "exposure", - "schema": "public", - "values": [ - "indoor", - "outdoor", - "mobile", - "unknown" - ] - }, - "public.model": { - "name": "model", - "schema": "public", - "values": [ - "HOME_V2_LORA" - ] - }, - "public.status": { - "name": "status", - "schema": "public", - "values": [ - "active", - "inactive", - "old" - ] - } - }, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": { - "public.measurement_10min": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_10min", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1day": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1day", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1hour": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1hour", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1month": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1month", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1year": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1year", - "schema": "public", - "isExisting": true, - "materialized": true - } - }, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/app/db/drizzle/meta/0012_snapshot.json b/app/db/drizzle/meta/0012_snapshot.json deleted file mode 100644 index 93a0d86c9..000000000 --- a/app/db/drizzle/meta/0012_snapshot.json +++ /dev/null @@ -1,967 +0,0 @@ -{ - "id": "da2da7ff-72a3-46ee-ac5f-92502a280488", - "prevId": "9547c380-88da-4d27-a2e5-9f07c0a554d0", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.device": { - "name": "device", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tags": { - "name": "tags", - "type": "text[]", - "primaryKey": false, - "notNull": false, - "default": "ARRAY[]::text[]" - }, - "link": { - "name": "link", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "use_auth": { - "name": "use_auth", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "exposure": { - "name": "exposure", - "type": "exposure", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "model": { - "name": "model", - "type": "model", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "latitude": { - "name": "latitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "longitude": { - "name": "longitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_model": { - "name": "sensor_wiki_model", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.device_to_location": { - "name": "device_to_location", - "schema": "", - "columns": { - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "location_id": { - "name": "location_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "device_to_location_device_id_device_id_fk": { - "name": "device_to_location_device_id_device_id_fk", - "tableFrom": "device_to_location", - "tableTo": "device", - "columnsFrom": [ - "device_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - }, - "device_to_location_location_id_location_id_fk": { - "name": "device_to_location_location_id_location_id_fk", - "tableFrom": "device_to_location", - "tableTo": "location", - "columnsFrom": [ - "location_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "device_to_location_device_id_location_id_time_pk": { - "name": "device_to_location_device_id_location_id_time_pk", - "columns": [ - "device_id", - "location_id", - "time" - ] - } - }, - "uniqueConstraints": { - "device_to_location_device_id_location_id_time_unique": { - "name": "device_to_location_device_id_location_id_time_unique", - "nullsNotDistinct": false, - "columns": [ - "device_id", - "location_id", - "time" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.measurement": { - "name": "measurement", - "schema": "", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "location_id": { - "name": "location_id", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "measurement_location_id_location_id_fk": { - "name": "measurement_location_id_location_id_fk", - "tableFrom": "measurement", - "tableTo": "location", - "columnsFrom": [ - "location_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "measurement_sensor_id_time_unique": { - "name": "measurement_sensor_id_time_unique", - "nullsNotDistinct": false, - "columns": [ - "sensor_id", - "time" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.password": { - "name": "password", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "password_user_id_user_id_fk": { - "name": "password_user_id_user_id_fk", - "tableFrom": "password", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile": { - "name": "profile", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "username": { - "name": "username", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_user_id_user_id_fk": { - "name": "profile_user_id_user_id_fk", - "tableFrom": "profile", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "profile_username_unique": { - "name": "profile_username_unique", - "nullsNotDistinct": false, - "columns": [ - "username" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile_image": { - "name": "profile_image", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "alt_text": { - "name": "alt_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "content_type": { - "name": "content_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "blob": { - "name": "blob", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "profile_id": { - "name": "profile_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_image_profile_id_profile_id_fk": { - "name": "profile_image_profile_id_profile_id_fk", - "tableFrom": "profile_image", - "tableTo": "profile", - "columnsFrom": [ - "profile_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.sensor": { - "name": "sensor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_type": { - "name": "sensor_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_type": { - "name": "sensor_wiki_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_phenomenon": { - "name": "sensor_wiki_phenomenon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_unit": { - "name": "sensor_wiki_unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "lastMeasurement": { - "name": "lastMeasurement", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "data": { - "name": "data", - "type": "json", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'user'" - }, - "language": { - "name": "language", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'en_US'" - }, - "email_is_confirmed": { - "name": "email_is_confirmed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "user_email_unique": { - "name": "user_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.location": { - "name": "location", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "location": { - "name": "location", - "type": "geometry(point)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "location_index": { - "name": "location_index", - "columns": [ - { - "expression": "location", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "location_location_unique": { - "name": "location_location_unique", - "nullsNotDistinct": false, - "columns": [ - "location" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.log_entry": { - "name": "log_entry", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "public.exposure": { - "name": "exposure", - "schema": "public", - "values": [ - "indoor", - "outdoor", - "mobile", - "unknown" - ] - }, - "public.model": { - "name": "model", - "schema": "public", - "values": [ - "homeV2Lora", - "homeV2Ethernet", - "homeV2Wifi", - "senseBox:Edu", - "luftdaten.info", - "Custom" - ] - }, - "public.status": { - "name": "status", - "schema": "public", - "values": [ - "active", - "inactive", - "old" - ] - } - }, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": { - "public.measurement_10min": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_10min", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1day": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1day", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1hour": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1hour", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1month": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1month", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1year": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1year", - "schema": "public", - "isExisting": true, - "materialized": true - } - }, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/app/db/drizzle/meta/0013_snapshot.json b/app/db/drizzle/meta/0013_snapshot.json deleted file mode 100644 index aec94c95d..000000000 --- a/app/db/drizzle/meta/0013_snapshot.json +++ /dev/null @@ -1,987 +0,0 @@ -{ - "id": "e97ae620-162c-4cdb-b520-602823aacfd7", - "prevId": "da2da7ff-72a3-46ee-ac5f-92502a280488", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.device": { - "name": "device", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tags": { - "name": "tags", - "type": "text[]", - "primaryKey": false, - "notNull": false, - "default": "ARRAY[]::text[]" - }, - "link": { - "name": "link", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "use_auth": { - "name": "use_auth", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "exposure": { - "name": "exposure", - "type": "exposure", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "model": { - "name": "model", - "type": "model", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "date", - "primaryKey": false, - "notNull": false - }, - "latitude": { - "name": "latitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "longitude": { - "name": "longitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_model": { - "name": "sensor_wiki_model", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.device_to_location": { - "name": "device_to_location", - "schema": "", - "columns": { - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "location_id": { - "name": "location_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "device_to_location_device_id_device_id_fk": { - "name": "device_to_location_device_id_device_id_fk", - "tableFrom": "device_to_location", - "tableTo": "device", - "columnsFrom": [ - "device_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - }, - "device_to_location_location_id_location_id_fk": { - "name": "device_to_location_location_id_location_id_fk", - "tableFrom": "device_to_location", - "tableTo": "location", - "columnsFrom": [ - "location_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "device_to_location_device_id_location_id_time_pk": { - "name": "device_to_location_device_id_location_id_time_pk", - "columns": [ - "device_id", - "location_id", - "time" - ] - } - }, - "uniqueConstraints": { - "device_to_location_device_id_location_id_time_unique": { - "name": "device_to_location_device_id_location_id_time_unique", - "nullsNotDistinct": false, - "columns": [ - "device_id", - "location_id", - "time" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.measurement": { - "name": "measurement", - "schema": "", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "location_id": { - "name": "location_id", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "measurement_location_id_location_id_fk": { - "name": "measurement_location_id_location_id_fk", - "tableFrom": "measurement", - "tableTo": "location", - "columnsFrom": [ - "location_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "measurement_sensor_id_time_unique": { - "name": "measurement_sensor_id_time_unique", - "nullsNotDistinct": false, - "columns": [ - "sensor_id", - "time" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.password": { - "name": "password", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "password_user_id_user_id_fk": { - "name": "password_user_id_user_id_fk", - "tableFrom": "password", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile": { - "name": "profile", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "username": { - "name": "username", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_user_id_user_id_fk": { - "name": "profile_user_id_user_id_fk", - "tableFrom": "profile", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "profile_username_unique": { - "name": "profile_username_unique", - "nullsNotDistinct": false, - "columns": [ - "username" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile_image": { - "name": "profile_image", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "alt_text": { - "name": "alt_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "content_type": { - "name": "content_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "blob": { - "name": "blob", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "profile_id": { - "name": "profile_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_image_profile_id_profile_id_fk": { - "name": "profile_image_profile_id_profile_id_fk", - "tableFrom": "profile_image", - "tableTo": "profile", - "columnsFrom": [ - "profile_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.sensor": { - "name": "sensor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_type": { - "name": "sensor_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_type": { - "name": "sensor_wiki_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_phenomenon": { - "name": "sensor_wiki_phenomenon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_unit": { - "name": "sensor_wiki_unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "lastMeasurement": { - "name": "lastMeasurement", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "data": { - "name": "data", - "type": "json", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "sensor_device_id_device_id_fk": { - "name": "sensor_device_id_device_id_fk", - "tableFrom": "sensor", - "tableTo": "device", - "columnsFrom": [ - "device_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'user'" - }, - "language": { - "name": "language", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'en_US'" - }, - "email_is_confirmed": { - "name": "email_is_confirmed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "user_email_unique": { - "name": "user_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.location": { - "name": "location", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "location": { - "name": "location", - "type": "geometry(point)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "location_index": { - "name": "location_index", - "columns": [ - { - "expression": "location", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "location_location_unique": { - "name": "location_location_unique", - "nullsNotDistinct": false, - "columns": [ - "location" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.log_entry": { - "name": "log_entry", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "public.exposure": { - "name": "exposure", - "schema": "public", - "values": [ - "indoor", - "outdoor", - "mobile", - "unknown" - ] - }, - "public.model": { - "name": "model", - "schema": "public", - "values": [ - "homeV2Lora", - "homeV2Ethernet", - "homeV2Wifi", - "senseBox:Edu", - "luftdaten.info", - "Custom" - ] - }, - "public.status": { - "name": "status", - "schema": "public", - "values": [ - "active", - "inactive", - "old" - ] - } - }, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": { - "public.measurement_10min": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_10min", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1day": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1day", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1hour": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1hour", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1month": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1month", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1year": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1year", - "schema": "public", - "isExisting": true, - "materialized": true - } - }, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/app/db/drizzle/meta/0014_snapshot.json b/app/db/drizzle/meta/0014_snapshot.json deleted file mode 100644 index d0b5c97d7..000000000 --- a/app/db/drizzle/meta/0014_snapshot.json +++ /dev/null @@ -1,987 +0,0 @@ -{ - "id": "3d604837-c99d-4ac6-8e1f-2d8b18455b5d", - "prevId": "e97ae620-162c-4cdb-b520-602823aacfd7", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.device": { - "name": "device", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tags": { - "name": "tags", - "type": "text[]", - "primaryKey": false, - "notNull": false, - "default": "ARRAY[]::text[]" - }, - "link": { - "name": "link", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "use_auth": { - "name": "use_auth", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "exposure": { - "name": "exposure", - "type": "exposure", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "model": { - "name": "model", - "type": "model", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "date", - "primaryKey": false, - "notNull": false - }, - "latitude": { - "name": "latitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "longitude": { - "name": "longitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_model": { - "name": "sensor_wiki_model", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.device_to_location": { - "name": "device_to_location", - "schema": "", - "columns": { - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "location_id": { - "name": "location_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "device_to_location_device_id_device_id_fk": { - "name": "device_to_location_device_id_device_id_fk", - "tableFrom": "device_to_location", - "columnsFrom": [ - "device_id" - ], - "tableTo": "device", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "cascade" - }, - "device_to_location_location_id_location_id_fk": { - "name": "device_to_location_location_id_location_id_fk", - "tableFrom": "device_to_location", - "columnsFrom": [ - "location_id" - ], - "tableTo": "location", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": { - "device_to_location_device_id_location_id_time_pk": { - "name": "device_to_location_device_id_location_id_time_pk", - "columns": [ - "device_id", - "location_id", - "time" - ] - } - }, - "uniqueConstraints": { - "device_to_location_device_id_location_id_time_unique": { - "name": "device_to_location_device_id_location_id_time_unique", - "columns": [ - "device_id", - "location_id", - "time" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.measurement": { - "name": "measurement", - "schema": "", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "location_id": { - "name": "location_id", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "measurement_location_id_location_id_fk": { - "name": "measurement_location_id_location_id_fk", - "tableFrom": "measurement", - "columnsFrom": [ - "location_id" - ], - "tableTo": "location", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "measurement_sensor_id_time_unique": { - "name": "measurement_sensor_id_time_unique", - "columns": [ - "sensor_id", - "time" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.password": { - "name": "password", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "password_user_id_user_id_fk": { - "name": "password_user_id_user_id_fk", - "tableFrom": "password", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile": { - "name": "profile", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "username": { - "name": "username", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_user_id_user_id_fk": { - "name": "profile_user_id_user_id_fk", - "tableFrom": "profile", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "profile_username_unique": { - "name": "profile_username_unique", - "columns": [ - "username" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile_image": { - "name": "profile_image", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "alt_text": { - "name": "alt_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "content_type": { - "name": "content_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "blob": { - "name": "blob", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "profile_id": { - "name": "profile_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_image_profile_id_profile_id_fk": { - "name": "profile_image_profile_id_profile_id_fk", - "tableFrom": "profile_image", - "columnsFrom": [ - "profile_id" - ], - "tableTo": "profile", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.sensor": { - "name": "sensor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_type": { - "name": "sensor_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_type": { - "name": "sensor_wiki_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_phenomenon": { - "name": "sensor_wiki_phenomenon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_unit": { - "name": "sensor_wiki_unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "lastMeasurement": { - "name": "lastMeasurement", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "data": { - "name": "data", - "type": "json", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "sensor_device_id_device_id_fk": { - "name": "sensor_device_id_device_id_fk", - "tableFrom": "sensor", - "columnsFrom": [ - "device_id" - ], - "tableTo": "device", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'user'" - }, - "language": { - "name": "language", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'en_US'" - }, - "email_is_confirmed": { - "name": "email_is_confirmed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "user_email_unique": { - "name": "user_email_unique", - "columns": [ - "email" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.location": { - "name": "location", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "location": { - "name": "location", - "type": "geometry(point)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "location_index": { - "name": "location_index", - "columns": [ - { - "expression": "location", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "location_location_unique": { - "name": "location_location_unique", - "columns": [ - "location" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.log_entry": { - "name": "log_entry", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "public.exposure": { - "name": "exposure", - "schema": "public", - "values": [ - "indoor", - "outdoor", - "mobile", - "unknown" - ] - }, - "public.model": { - "name": "model", - "schema": "public", - "values": [ - "homeV2Lora", - "homeV2Ethernet", - "homeV2Wifi", - "senseBox:Edu", - "luftdaten.info", - "Custom" - ] - }, - "public.status": { - "name": "status", - "schema": "public", - "values": [ - "active", - "inactive", - "old" - ] - } - }, - "schemas": {}, - "views": { - "public.measurement_10min": { - "name": "measurement_10min", - "schema": "public", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "materialized": true, - "isExisting": true - }, - "public.measurement_1day": { - "name": "measurement_1day", - "schema": "public", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "materialized": true, - "isExisting": true - }, - "public.measurement_1hour": { - "name": "measurement_1hour", - "schema": "public", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "materialized": true, - "isExisting": true - }, - "public.measurement_1month": { - "name": "measurement_1month", - "schema": "public", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "materialized": true, - "isExisting": true - }, - "public.measurement_1year": { - "name": "measurement_1year", - "schema": "public", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "materialized": true, - "isExisting": true - } - }, - "sequences": {}, - "roles": {}, - "policies": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/app/db/drizzle/meta/0015_snapshot.json b/app/db/drizzle/meta/0015_snapshot.json deleted file mode 100644 index e9603efd5..000000000 --- a/app/db/drizzle/meta/0015_snapshot.json +++ /dev/null @@ -1,987 +0,0 @@ -{ - "id": "8aea00c4-c635-420b-86ea-cac6c2069424", - "prevId": "3d604837-c99d-4ac6-8e1f-2d8b18455b5d", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.device": { - "name": "device", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tags": { - "name": "tags", - "type": "text[]", - "primaryKey": false, - "notNull": false, - "default": "ARRAY[]::text[]" - }, - "link": { - "name": "link", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "use_auth": { - "name": "use_auth", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "exposure": { - "name": "exposure", - "type": "exposure", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "model": { - "name": "model", - "type": "model", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "date", - "primaryKey": false, - "notNull": false - }, - "latitude": { - "name": "latitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "longitude": { - "name": "longitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_model": { - "name": "sensor_wiki_model", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.device_to_location": { - "name": "device_to_location", - "schema": "", - "columns": { - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "location_id": { - "name": "location_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "device_to_location_device_id_device_id_fk": { - "name": "device_to_location_device_id_device_id_fk", - "tableFrom": "device_to_location", - "tableTo": "device", - "columnsFrom": [ - "device_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - }, - "device_to_location_location_id_location_id_fk": { - "name": "device_to_location_location_id_location_id_fk", - "tableFrom": "device_to_location", - "tableTo": "location", - "columnsFrom": [ - "location_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "device_to_location_device_id_location_id_time_pk": { - "name": "device_to_location_device_id_location_id_time_pk", - "columns": [ - "device_id", - "location_id", - "time" - ] - } - }, - "uniqueConstraints": { - "device_to_location_device_id_location_id_time_unique": { - "name": "device_to_location_device_id_location_id_time_unique", - "nullsNotDistinct": false, - "columns": [ - "device_id", - "location_id", - "time" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.measurement": { - "name": "measurement", - "schema": "", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "location_id": { - "name": "location_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "measurement_location_id_location_id_fk": { - "name": "measurement_location_id_location_id_fk", - "tableFrom": "measurement", - "tableTo": "location", - "columnsFrom": [ - "location_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "measurement_sensor_id_time_unique": { - "name": "measurement_sensor_id_time_unique", - "nullsNotDistinct": false, - "columns": [ - "sensor_id", - "time" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.password": { - "name": "password", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "password_user_id_user_id_fk": { - "name": "password_user_id_user_id_fk", - "tableFrom": "password", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile": { - "name": "profile", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "username": { - "name": "username", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_user_id_user_id_fk": { - "name": "profile_user_id_user_id_fk", - "tableFrom": "profile", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "profile_username_unique": { - "name": "profile_username_unique", - "nullsNotDistinct": false, - "columns": [ - "username" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile_image": { - "name": "profile_image", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "alt_text": { - "name": "alt_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "content_type": { - "name": "content_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "blob": { - "name": "blob", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "profile_id": { - "name": "profile_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_image_profile_id_profile_id_fk": { - "name": "profile_image_profile_id_profile_id_fk", - "tableFrom": "profile_image", - "tableTo": "profile", - "columnsFrom": [ - "profile_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.sensor": { - "name": "sensor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_type": { - "name": "sensor_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_type": { - "name": "sensor_wiki_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_phenomenon": { - "name": "sensor_wiki_phenomenon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_unit": { - "name": "sensor_wiki_unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "lastMeasurement": { - "name": "lastMeasurement", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "data": { - "name": "data", - "type": "json", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "sensor_device_id_device_id_fk": { - "name": "sensor_device_id_device_id_fk", - "tableFrom": "sensor", - "tableTo": "device", - "columnsFrom": [ - "device_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'user'" - }, - "language": { - "name": "language", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'en_US'" - }, - "email_is_confirmed": { - "name": "email_is_confirmed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "user_email_unique": { - "name": "user_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.location": { - "name": "location", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "location": { - "name": "location", - "type": "geometry(point)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "location_index": { - "name": "location_index", - "columns": [ - { - "expression": "location", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "location_location_unique": { - "name": "location_location_unique", - "nullsNotDistinct": false, - "columns": [ - "location" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.log_entry": { - "name": "log_entry", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "public.exposure": { - "name": "exposure", - "schema": "public", - "values": [ - "indoor", - "outdoor", - "mobile", - "unknown" - ] - }, - "public.model": { - "name": "model", - "schema": "public", - "values": [ - "homeV2Lora", - "homeV2Ethernet", - "homeV2Wifi", - "senseBox:Edu", - "luftdaten.info", - "Custom" - ] - }, - "public.status": { - "name": "status", - "schema": "public", - "values": [ - "active", - "inactive", - "old" - ] - } - }, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": { - "public.measurement_10min": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_10min", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1day": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1day", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1hour": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1hour", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1month": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1month", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1year": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1year", - "schema": "public", - "isExisting": true, - "materialized": true - } - }, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/app/db/drizzle/meta/0016_snapshot.json b/app/db/drizzle/meta/0016_snapshot.json deleted file mode 100644 index cd44f9cd5..000000000 --- a/app/db/drizzle/meta/0016_snapshot.json +++ /dev/null @@ -1,1032 +0,0 @@ -{ - "id": "7b0ed096-a139-4a21-a6dc-cf2c06a63b80", - "prevId": "8aea00c4-c635-420b-86ea-cac6c2069424", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.device": { - "name": "device", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tags": { - "name": "tags", - "type": "text[]", - "primaryKey": false, - "notNull": false, - "default": "ARRAY[]::text[]" - }, - "link": { - "name": "link", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "use_auth": { - "name": "use_auth", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "exposure": { - "name": "exposure", - "type": "exposure", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "model": { - "name": "model", - "type": "model", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "date", - "primaryKey": false, - "notNull": false - }, - "latitude": { - "name": "latitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "longitude": { - "name": "longitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_model": { - "name": "sensor_wiki_model", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.device_to_location": { - "name": "device_to_location", - "schema": "", - "columns": { - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "location_id": { - "name": "location_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "device_to_location_device_id_device_id_fk": { - "name": "device_to_location_device_id_device_id_fk", - "tableFrom": "device_to_location", - "tableTo": "device", - "columnsFrom": [ - "device_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - }, - "device_to_location_location_id_location_id_fk": { - "name": "device_to_location_location_id_location_id_fk", - "tableFrom": "device_to_location", - "tableTo": "location", - "columnsFrom": [ - "location_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "device_to_location_device_id_location_id_time_pk": { - "name": "device_to_location_device_id_location_id_time_pk", - "columns": [ - "device_id", - "location_id", - "time" - ] - } - }, - "uniqueConstraints": { - "device_to_location_device_id_location_id_time_unique": { - "name": "device_to_location_device_id_location_id_time_unique", - "nullsNotDistinct": false, - "columns": [ - "device_id", - "location_id", - "time" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.measurement": { - "name": "measurement", - "schema": "", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "location_id": { - "name": "location_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "measurement_location_id_location_id_fk": { - "name": "measurement_location_id_location_id_fk", - "tableFrom": "measurement", - "tableTo": "location", - "columnsFrom": [ - "location_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "measurement_sensor_id_time_unique": { - "name": "measurement_sensor_id_time_unique", - "nullsNotDistinct": false, - "columns": [ - "sensor_id", - "time" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.password": { - "name": "password", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "password_user_id_user_id_fk": { - "name": "password_user_id_user_id_fk", - "tableFrom": "password", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile": { - "name": "profile", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "username": { - "name": "username", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_user_id_user_id_fk": { - "name": "profile_user_id_user_id_fk", - "tableFrom": "profile", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "profile_username_unique": { - "name": "profile_username_unique", - "nullsNotDistinct": false, - "columns": [ - "username" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile_image": { - "name": "profile_image", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "alt_text": { - "name": "alt_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "content_type": { - "name": "content_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "blob": { - "name": "blob", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "profile_id": { - "name": "profile_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_image_profile_id_profile_id_fk": { - "name": "profile_image_profile_id_profile_id_fk", - "tableFrom": "profile_image", - "tableTo": "profile", - "columnsFrom": [ - "profile_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.sensor": { - "name": "sensor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_type": { - "name": "sensor_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_type": { - "name": "sensor_wiki_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_phenomenon": { - "name": "sensor_wiki_phenomenon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_unit": { - "name": "sensor_wiki_unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "lastMeasurement": { - "name": "lastMeasurement", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "data": { - "name": "data", - "type": "json", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "sensor_device_id_device_id_fk": { - "name": "sensor_device_id_device_id_fk", - "tableFrom": "sensor", - "tableTo": "device", - "columnsFrom": [ - "device_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'user'" - }, - "language": { - "name": "language", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'en_US'" - }, - "email_is_confirmed": { - "name": "email_is_confirmed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "user_email_unique": { - "name": "user_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.location": { - "name": "location", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "location": { - "name": "location", - "type": "geometry(point)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "location_index": { - "name": "location_index", - "columns": [ - { - "expression": "location", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "location_location_unique": { - "name": "location_location_unique", - "nullsNotDistinct": false, - "columns": [ - "location" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.log_entry": { - "name": "log_entry", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.refresh_token": { - "name": "refresh_token", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "refresh_token_user_id_user_id_fk": { - "name": "refresh_token_user_id_user_id_fk", - "tableFrom": "refresh_token", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "public.exposure": { - "name": "exposure", - "schema": "public", - "values": [ - "indoor", - "outdoor", - "mobile", - "unknown" - ] - }, - "public.model": { - "name": "model", - "schema": "public", - "values": [ - "homeV2Lora", - "homeV2Ethernet", - "homeV2Wifi", - "senseBox:Edu", - "luftdaten.info", - "Custom" - ] - }, - "public.status": { - "name": "status", - "schema": "public", - "values": [ - "active", - "inactive", - "old" - ] - } - }, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": { - "public.measurement_10min": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_10min", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1day": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1day", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1hour": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1hour", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1month": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1month", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1year": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1year", - "schema": "public", - "isExisting": true, - "materialized": true - } - }, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/app/db/drizzle/meta/0017_snapshot.json b/app/db/drizzle/meta/0017_snapshot.json deleted file mode 100644 index 3c1a956d2..000000000 --- a/app/db/drizzle/meta/0017_snapshot.json +++ /dev/null @@ -1,1063 +0,0 @@ -{ - "id": "76f42cd3-4ce5-4e6e-b3d6-5460a167ffbb", - "prevId": "7b0ed096-a139-4a21-a6dc-cf2c06a63b80", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.device": { - "name": "device", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tags": { - "name": "tags", - "type": "text[]", - "primaryKey": false, - "notNull": false, - "default": "ARRAY[]::text[]" - }, - "link": { - "name": "link", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "use_auth": { - "name": "use_auth", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "exposure": { - "name": "exposure", - "type": "exposure", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "model": { - "name": "model", - "type": "model", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "date", - "primaryKey": false, - "notNull": false - }, - "latitude": { - "name": "latitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "longitude": { - "name": "longitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_model": { - "name": "sensor_wiki_model", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.device_to_location": { - "name": "device_to_location", - "schema": "", - "columns": { - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "location_id": { - "name": "location_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "device_to_location_device_id_device_id_fk": { - "name": "device_to_location_device_id_device_id_fk", - "tableFrom": "device_to_location", - "tableTo": "device", - "columnsFrom": [ - "device_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - }, - "device_to_location_location_id_location_id_fk": { - "name": "device_to_location_location_id_location_id_fk", - "tableFrom": "device_to_location", - "tableTo": "location", - "columnsFrom": [ - "location_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "device_to_location_device_id_location_id_time_pk": { - "name": "device_to_location_device_id_location_id_time_pk", - "columns": [ - "device_id", - "location_id", - "time" - ] - } - }, - "uniqueConstraints": { - "device_to_location_device_id_location_id_time_unique": { - "name": "device_to_location_device_id_location_id_time_unique", - "nullsNotDistinct": false, - "columns": [ - "device_id", - "location_id", - "time" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.measurement": { - "name": "measurement", - "schema": "", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "location_id": { - "name": "location_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "measurement_location_id_location_id_fk": { - "name": "measurement_location_id_location_id_fk", - "tableFrom": "measurement", - "tableTo": "location", - "columnsFrom": [ - "location_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "measurement_sensor_id_time_unique": { - "name": "measurement_sensor_id_time_unique", - "nullsNotDistinct": false, - "columns": [ - "sensor_id", - "time" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.password": { - "name": "password", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "password_user_id_user_id_fk": { - "name": "password_user_id_user_id_fk", - "tableFrom": "password", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile": { - "name": "profile", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "username": { - "name": "username", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_user_id_user_id_fk": { - "name": "profile_user_id_user_id_fk", - "tableFrom": "profile", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "profile_username_unique": { - "name": "profile_username_unique", - "nullsNotDistinct": false, - "columns": [ - "username" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile_image": { - "name": "profile_image", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "alt_text": { - "name": "alt_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "content_type": { - "name": "content_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "blob": { - "name": "blob", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "profile_id": { - "name": "profile_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_image_profile_id_profile_id_fk": { - "name": "profile_image_profile_id_profile_id_fk", - "tableFrom": "profile_image", - "tableTo": "profile", - "columnsFrom": [ - "profile_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.sensor": { - "name": "sensor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_type": { - "name": "sensor_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_type": { - "name": "sensor_wiki_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_phenomenon": { - "name": "sensor_wiki_phenomenon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_unit": { - "name": "sensor_wiki_unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "lastMeasurement": { - "name": "lastMeasurement", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "data": { - "name": "data", - "type": "json", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "sensor_device_id_device_id_fk": { - "name": "sensor_device_id_device_id_fk", - "tableFrom": "sensor", - "tableTo": "device", - "columnsFrom": [ - "device_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'user'" - }, - "language": { - "name": "language", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'en_US'" - }, - "email_is_confirmed": { - "name": "email_is_confirmed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "user_email_unique": { - "name": "user_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.location": { - "name": "location", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "location": { - "name": "location", - "type": "geometry(point)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "location_index": { - "name": "location_index", - "columns": [ - { - "expression": "location", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "location_location_unique": { - "name": "location_location_unique", - "nullsNotDistinct": false, - "columns": [ - "location" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.log_entry": { - "name": "log_entry", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.refresh_token": { - "name": "refresh_token", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "refresh_token_user_id_user_id_fk": { - "name": "refresh_token_user_id_user_id_fk", - "tableFrom": "refresh_token", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.token_revocation": { - "name": "token_revocation", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "public.exposure": { - "name": "exposure", - "schema": "public", - "values": [ - "indoor", - "outdoor", - "mobile", - "unknown" - ] - }, - "public.model": { - "name": "model", - "schema": "public", - "values": [ - "homeV2Lora", - "homeV2Ethernet", - "homeV2Wifi", - "senseBox:Edu", - "luftdaten.info", - "Custom" - ] - }, - "public.status": { - "name": "status", - "schema": "public", - "values": [ - "active", - "inactive", - "old" - ] - } - }, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": { - "public.measurement_10min": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_10min", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1day": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1day", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1hour": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1hour", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1month": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1month", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1year": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1year", - "schema": "public", - "isExisting": true, - "materialized": true - } - }, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/app/db/drizzle/meta/0018_snapshot.json b/app/db/drizzle/meta/0018_snapshot.json deleted file mode 100644 index 6373a74b5..000000000 --- a/app/db/drizzle/meta/0018_snapshot.json +++ /dev/null @@ -1,1063 +0,0 @@ -{ - "id": "655c6d50-c7c2-4cee-99bd-7eb38e2257ad", - "prevId": "76f42cd3-4ce5-4e6e-b3d6-5460a167ffbb", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.device": { - "name": "device", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tags": { - "name": "tags", - "type": "text[]", - "primaryKey": false, - "notNull": false, - "default": "ARRAY[]::text[]" - }, - "link": { - "name": "link", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "use_auth": { - "name": "use_auth", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "exposure": { - "name": "exposure", - "type": "exposure", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "model": { - "name": "model", - "type": "model", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "date", - "primaryKey": false, - "notNull": false - }, - "latitude": { - "name": "latitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "longitude": { - "name": "longitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_model": { - "name": "sensor_wiki_model", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.device_to_location": { - "name": "device_to_location", - "schema": "", - "columns": { - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "location_id": { - "name": "location_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "device_to_location_device_id_device_id_fk": { - "name": "device_to_location_device_id_device_id_fk", - "tableFrom": "device_to_location", - "tableTo": "device", - "columnsFrom": [ - "device_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - }, - "device_to_location_location_id_location_id_fk": { - "name": "device_to_location_location_id_location_id_fk", - "tableFrom": "device_to_location", - "tableTo": "location", - "columnsFrom": [ - "location_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "device_to_location_device_id_location_id_time_pk": { - "name": "device_to_location_device_id_location_id_time_pk", - "columns": [ - "device_id", - "location_id", - "time" - ] - } - }, - "uniqueConstraints": { - "device_to_location_device_id_location_id_time_unique": { - "name": "device_to_location_device_id_location_id_time_unique", - "nullsNotDistinct": false, - "columns": [ - "device_id", - "location_id", - "time" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.measurement": { - "name": "measurement", - "schema": "", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "location_id": { - "name": "location_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "measurement_location_id_location_id_fk": { - "name": "measurement_location_id_location_id_fk", - "tableFrom": "measurement", - "tableTo": "location", - "columnsFrom": [ - "location_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "measurement_sensor_id_time_unique": { - "name": "measurement_sensor_id_time_unique", - "nullsNotDistinct": false, - "columns": [ - "sensor_id", - "time" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.password": { - "name": "password", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "password_user_id_user_id_fk": { - "name": "password_user_id_user_id_fk", - "tableFrom": "password", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile": { - "name": "profile", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "username": { - "name": "username", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_user_id_user_id_fk": { - "name": "profile_user_id_user_id_fk", - "tableFrom": "profile", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "profile_username_unique": { - "name": "profile_username_unique", - "nullsNotDistinct": false, - "columns": [ - "username" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile_image": { - "name": "profile_image", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "alt_text": { - "name": "alt_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "content_type": { - "name": "content_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "blob": { - "name": "blob", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "profile_id": { - "name": "profile_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_image_profile_id_profile_id_fk": { - "name": "profile_image_profile_id_profile_id_fk", - "tableFrom": "profile_image", - "tableTo": "profile", - "columnsFrom": [ - "profile_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.sensor": { - "name": "sensor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_type": { - "name": "sensor_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_type": { - "name": "sensor_wiki_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_phenomenon": { - "name": "sensor_wiki_phenomenon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_unit": { - "name": "sensor_wiki_unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "lastMeasurement": { - "name": "lastMeasurement", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "data": { - "name": "data", - "type": "json", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "sensor_device_id_device_id_fk": { - "name": "sensor_device_id_device_id_fk", - "tableFrom": "sensor", - "tableTo": "device", - "columnsFrom": [ - "device_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'user'" - }, - "language": { - "name": "language", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'en_US'" - }, - "email_is_confirmed": { - "name": "email_is_confirmed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "user_email_unique": { - "name": "user_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.location": { - "name": "location", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "location": { - "name": "location", - "type": "geometry(point)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "location_index": { - "name": "location_index", - "columns": [ - { - "expression": "location", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "location_location_unique": { - "name": "location_location_unique", - "nullsNotDistinct": false, - "columns": [ - "location" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.log_entry": { - "name": "log_entry", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.refresh_token": { - "name": "refresh_token", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "refresh_token_user_id_user_id_fk": { - "name": "refresh_token_user_id_user_id_fk", - "tableFrom": "refresh_token", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.token_revocation": { - "name": "token_revocation", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "json", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "public.exposure": { - "name": "exposure", - "schema": "public", - "values": [ - "indoor", - "outdoor", - "mobile", - "unknown" - ] - }, - "public.model": { - "name": "model", - "schema": "public", - "values": [ - "homeV2Lora", - "homeV2Ethernet", - "homeV2Wifi", - "senseBox:Edu", - "luftdaten.info", - "Custom" - ] - }, - "public.status": { - "name": "status", - "schema": "public", - "values": [ - "active", - "inactive", - "old" - ] - } - }, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": { - "public.measurement_10min": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_10min", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1day": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1day", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1hour": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1hour", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1month": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1month", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1year": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1year", - "schema": "public", - "isExisting": true, - "materialized": true - } - }, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/app/db/drizzle/meta/0019_snapshot.json b/app/db/drizzle/meta/0019_snapshot.json deleted file mode 100644 index 8f53f7a10..000000000 --- a/app/db/drizzle/meta/0019_snapshot.json +++ /dev/null @@ -1,1082 +0,0 @@ -{ - "id": "2083dc9a-c5d0-4805-b9c1-4331f4172065", - "prevId": "655c6d50-c7c2-4cee-99bd-7eb38e2257ad", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.device": { - "name": "device", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tags": { - "name": "tags", - "type": "text[]", - "primaryKey": false, - "notNull": false, - "default": "ARRAY[]::text[]" - }, - "link": { - "name": "link", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "use_auth": { - "name": "use_auth", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "exposure": { - "name": "exposure", - "type": "exposure", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "model": { - "name": "model", - "type": "model", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "date", - "primaryKey": false, - "notNull": false - }, - "latitude": { - "name": "latitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "longitude": { - "name": "longitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_model": { - "name": "sensor_wiki_model", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.device_to_location": { - "name": "device_to_location", - "schema": "", - "columns": { - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "location_id": { - "name": "location_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "device_to_location_device_id_device_id_fk": { - "name": "device_to_location_device_id_device_id_fk", - "tableFrom": "device_to_location", - "tableTo": "device", - "columnsFrom": [ - "device_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - }, - "device_to_location_location_id_location_id_fk": { - "name": "device_to_location_location_id_location_id_fk", - "tableFrom": "device_to_location", - "tableTo": "location", - "columnsFrom": [ - "location_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "device_to_location_device_id_location_id_time_pk": { - "name": "device_to_location_device_id_location_id_time_pk", - "columns": [ - "device_id", - "location_id", - "time" - ] - } - }, - "uniqueConstraints": { - "device_to_location_device_id_location_id_time_unique": { - "name": "device_to_location_device_id_location_id_time_unique", - "nullsNotDistinct": false, - "columns": [ - "device_id", - "location_id", - "time" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.measurement": { - "name": "measurement", - "schema": "", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "location_id": { - "name": "location_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "measurement_location_id_location_id_fk": { - "name": "measurement_location_id_location_id_fk", - "tableFrom": "measurement", - "tableTo": "location", - "columnsFrom": [ - "location_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "measurement_sensor_id_time_unique": { - "name": "measurement_sensor_id_time_unique", - "nullsNotDistinct": false, - "columns": [ - "sensor_id", - "time" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.password": { - "name": "password", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "password_user_id_user_id_fk": { - "name": "password_user_id_user_id_fk", - "tableFrom": "password", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile": { - "name": "profile", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "username": { - "name": "username", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_user_id_user_id_fk": { - "name": "profile_user_id_user_id_fk", - "tableFrom": "profile", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "profile_username_unique": { - "name": "profile_username_unique", - "nullsNotDistinct": false, - "columns": [ - "username" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile_image": { - "name": "profile_image", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "alt_text": { - "name": "alt_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "content_type": { - "name": "content_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "blob": { - "name": "blob", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "profile_id": { - "name": "profile_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_image_profile_id_profile_id_fk": { - "name": "profile_image_profile_id_profile_id_fk", - "tableFrom": "profile_image", - "tableTo": "profile", - "columnsFrom": [ - "profile_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.sensor": { - "name": "sensor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_type": { - "name": "sensor_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_type": { - "name": "sensor_wiki_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_phenomenon": { - "name": "sensor_wiki_phenomenon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_unit": { - "name": "sensor_wiki_unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "lastMeasurement": { - "name": "lastMeasurement", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "data": { - "name": "data", - "type": "json", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "sensor_device_id_device_id_fk": { - "name": "sensor_device_id_device_id_fk", - "tableFrom": "sensor", - "tableTo": "device", - "columnsFrom": [ - "device_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "unconfirmed_email": { - "name": "unconfirmed_email", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'user'" - }, - "language": { - "name": "language", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'en_US'" - }, - "email_is_confirmed": { - "name": "email_is_confirmed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "email_confirmation_token": { - "name": "email_confirmation_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "user_email_unique": { - "name": "user_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - }, - "user_unconfirmed_email_unique": { - "name": "user_unconfirmed_email_unique", - "nullsNotDistinct": false, - "columns": [ - "unconfirmed_email" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.location": { - "name": "location", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "location": { - "name": "location", - "type": "geometry(point)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "location_index": { - "name": "location_index", - "columns": [ - { - "expression": "location", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "location_location_unique": { - "name": "location_location_unique", - "nullsNotDistinct": false, - "columns": [ - "location" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.log_entry": { - "name": "log_entry", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.refresh_token": { - "name": "refresh_token", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "refresh_token_user_id_user_id_fk": { - "name": "refresh_token_user_id_user_id_fk", - "tableFrom": "refresh_token", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.token_revocation": { - "name": "token_revocation", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "json", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "public.exposure": { - "name": "exposure", - "schema": "public", - "values": [ - "indoor", - "outdoor", - "mobile", - "unknown" - ] - }, - "public.model": { - "name": "model", - "schema": "public", - "values": [ - "homeV2Lora", - "homeV2Ethernet", - "homeV2Wifi", - "senseBox:Edu", - "luftdaten.info", - "Custom" - ] - }, - "public.status": { - "name": "status", - "schema": "public", - "values": [ - "active", - "inactive", - "old" - ] - } - }, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": { - "public.measurement_10min": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_10min", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1day": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1day", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1hour": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1hour", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1month": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1month", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1year": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1year", - "schema": "public", - "isExisting": true, - "materialized": true - } - }, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/app/db/drizzle/meta/0020_snapshot.json b/app/db/drizzle/meta/0020_snapshot.json deleted file mode 100644 index 7e7be36cd..000000000 --- a/app/db/drizzle/meta/0020_snapshot.json +++ /dev/null @@ -1,1135 +0,0 @@ -{ - "id": "9d89599f-78ef-4878-85a7-91a31bf984dc", - "prevId": "2083dc9a-c5d0-4805-b9c1-4331f4172065", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.device": { - "name": "device", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tags": { - "name": "tags", - "type": "text[]", - "primaryKey": false, - "notNull": false, - "default": "ARRAY[]::text[]" - }, - "link": { - "name": "link", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "use_auth": { - "name": "use_auth", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "exposure": { - "name": "exposure", - "type": "exposure", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "model": { - "name": "model", - "type": "model", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "date", - "primaryKey": false, - "notNull": false - }, - "latitude": { - "name": "latitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "longitude": { - "name": "longitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_model": { - "name": "sensor_wiki_model", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.device_to_location": { - "name": "device_to_location", - "schema": "", - "columns": { - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "location_id": { - "name": "location_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "device_to_location_device_id_device_id_fk": { - "name": "device_to_location_device_id_device_id_fk", - "tableFrom": "device_to_location", - "tableTo": "device", - "columnsFrom": [ - "device_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - }, - "device_to_location_location_id_location_id_fk": { - "name": "device_to_location_location_id_location_id_fk", - "tableFrom": "device_to_location", - "tableTo": "location", - "columnsFrom": [ - "location_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "device_to_location_device_id_location_id_time_pk": { - "name": "device_to_location_device_id_location_id_time_pk", - "columns": [ - "device_id", - "location_id", - "time" - ] - } - }, - "uniqueConstraints": { - "device_to_location_device_id_location_id_time_unique": { - "name": "device_to_location_device_id_location_id_time_unique", - "nullsNotDistinct": false, - "columns": [ - "device_id", - "location_id", - "time" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.measurement": { - "name": "measurement", - "schema": "", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "location_id": { - "name": "location_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "measurement_location_id_location_id_fk": { - "name": "measurement_location_id_location_id_fk", - "tableFrom": "measurement", - "tableTo": "location", - "columnsFrom": [ - "location_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "measurement_sensor_id_time_unique": { - "name": "measurement_sensor_id_time_unique", - "nullsNotDistinct": false, - "columns": [ - "sensor_id", - "time" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.password": { - "name": "password", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "password_user_id_user_id_fk": { - "name": "password_user_id_user_id_fk", - "tableFrom": "password", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.password_reset_request": { - "name": "password_reset_request", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "password_reset_request_user_id_user_id_fk": { - "name": "password_reset_request_user_id_user_id_fk", - "tableFrom": "password_reset_request", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "password_reset_request_user_id_unique": { - "name": "password_reset_request_user_id_unique", - "nullsNotDistinct": false, - "columns": [ - "user_id" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile": { - "name": "profile", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "username": { - "name": "username", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_user_id_user_id_fk": { - "name": "profile_user_id_user_id_fk", - "tableFrom": "profile", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "profile_username_unique": { - "name": "profile_username_unique", - "nullsNotDistinct": false, - "columns": [ - "username" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile_image": { - "name": "profile_image", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "alt_text": { - "name": "alt_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "content_type": { - "name": "content_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "blob": { - "name": "blob", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "profile_id": { - "name": "profile_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_image_profile_id_profile_id_fk": { - "name": "profile_image_profile_id_profile_id_fk", - "tableFrom": "profile_image", - "tableTo": "profile", - "columnsFrom": [ - "profile_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.sensor": { - "name": "sensor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_type": { - "name": "sensor_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_type": { - "name": "sensor_wiki_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_phenomenon": { - "name": "sensor_wiki_phenomenon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_unit": { - "name": "sensor_wiki_unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "lastMeasurement": { - "name": "lastMeasurement", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "data": { - "name": "data", - "type": "json", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "sensor_device_id_device_id_fk": { - "name": "sensor_device_id_device_id_fk", - "tableFrom": "sensor", - "tableTo": "device", - "columnsFrom": [ - "device_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "unconfirmed_email": { - "name": "unconfirmed_email", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'user'" - }, - "language": { - "name": "language", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'en_US'" - }, - "email_is_confirmed": { - "name": "email_is_confirmed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "email_confirmation_token": { - "name": "email_confirmation_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "user_email_unique": { - "name": "user_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - }, - "user_unconfirmed_email_unique": { - "name": "user_unconfirmed_email_unique", - "nullsNotDistinct": false, - "columns": [ - "unconfirmed_email" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.location": { - "name": "location", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "location": { - "name": "location", - "type": "geometry(point)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "location_index": { - "name": "location_index", - "columns": [ - { - "expression": "location", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "location_location_unique": { - "name": "location_location_unique", - "nullsNotDistinct": false, - "columns": [ - "location" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.log_entry": { - "name": "log_entry", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.refresh_token": { - "name": "refresh_token", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "refresh_token_user_id_user_id_fk": { - "name": "refresh_token_user_id_user_id_fk", - "tableFrom": "refresh_token", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.token_revocation": { - "name": "token_revocation", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "json", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "public.exposure": { - "name": "exposure", - "schema": "public", - "values": [ - "indoor", - "outdoor", - "mobile", - "unknown" - ] - }, - "public.model": { - "name": "model", - "schema": "public", - "values": [ - "homeV2Lora", - "homeV2Ethernet", - "homeV2Wifi", - "senseBox:Edu", - "luftdaten.info", - "Custom" - ] - }, - "public.status": { - "name": "status", - "schema": "public", - "values": [ - "active", - "inactive", - "old" - ] - } - }, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": { - "public.measurement_10min": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_10min", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1day": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1day", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1hour": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1hour", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1month": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1month", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1year": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1year", - "schema": "public", - "isExisting": true, - "materialized": true - } - }, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/app/db/drizzle/meta/0021_snapshot.json b/app/db/drizzle/meta/0021_snapshot.json deleted file mode 100644 index 168b62c70..000000000 --- a/app/db/drizzle/meta/0021_snapshot.json +++ /dev/null @@ -1,1174 +0,0 @@ -{ - "id": "85481101-dd0d-4e15-9158-11971b8ba509", - "prevId": "9d89599f-78ef-4878-85a7-91a31bf984dc", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.device": { - "name": "device", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tags": { - "name": "tags", - "type": "text[]", - "primaryKey": false, - "notNull": false, - "default": "ARRAY[]::text[]" - }, - "link": { - "name": "link", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "use_auth": { - "name": "use_auth", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "exposure": { - "name": "exposure", - "type": "exposure", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "model": { - "name": "model", - "type": "model", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "date", - "primaryKey": false, - "notNull": false - }, - "latitude": { - "name": "latitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "longitude": { - "name": "longitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_model": { - "name": "sensor_wiki_model", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.device_to_location": { - "name": "device_to_location", - "schema": "", - "columns": { - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "location_id": { - "name": "location_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "device_to_location_device_id_device_id_fk": { - "name": "device_to_location_device_id_device_id_fk", - "tableFrom": "device_to_location", - "tableTo": "device", - "columnsFrom": [ - "device_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - }, - "device_to_location_location_id_location_id_fk": { - "name": "device_to_location_location_id_location_id_fk", - "tableFrom": "device_to_location", - "tableTo": "location", - "columnsFrom": [ - "location_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "device_to_location_device_id_location_id_time_pk": { - "name": "device_to_location_device_id_location_id_time_pk", - "columns": [ - "device_id", - "location_id", - "time" - ] - } - }, - "uniqueConstraints": { - "device_to_location_device_id_location_id_time_unique": { - "name": "device_to_location_device_id_location_id_time_unique", - "nullsNotDistinct": false, - "columns": [ - "device_id", - "location_id", - "time" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.measurement": { - "name": "measurement", - "schema": "", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "location_id": { - "name": "location_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "measurement_location_id_location_id_fk": { - "name": "measurement_location_id_location_id_fk", - "tableFrom": "measurement", - "tableTo": "location", - "columnsFrom": [ - "location_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "measurement_sensor_id_time_unique": { - "name": "measurement_sensor_id_time_unique", - "nullsNotDistinct": false, - "columns": [ - "sensor_id", - "time" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.password": { - "name": "password", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "password_user_id_user_id_fk": { - "name": "password_user_id_user_id_fk", - "tableFrom": "password", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.password_reset_request": { - "name": "password_reset_request", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "password_reset_request_user_id_user_id_fk": { - "name": "password_reset_request_user_id_user_id_fk", - "tableFrom": "password_reset_request", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "password_reset_request_user_id_unique": { - "name": "password_reset_request_user_id_unique", - "nullsNotDistinct": false, - "columns": [ - "user_id" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile": { - "name": "profile", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "username": { - "name": "username", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_user_id_user_id_fk": { - "name": "profile_user_id_user_id_fk", - "tableFrom": "profile", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "profile_username_unique": { - "name": "profile_username_unique", - "nullsNotDistinct": false, - "columns": [ - "username" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile_image": { - "name": "profile_image", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "alt_text": { - "name": "alt_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "content_type": { - "name": "content_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "blob": { - "name": "blob", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "profile_id": { - "name": "profile_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_image_profile_id_profile_id_fk": { - "name": "profile_image_profile_id_profile_id_fk", - "tableFrom": "profile_image", - "tableTo": "profile", - "columnsFrom": [ - "profile_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.sensor": { - "name": "sensor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_type": { - "name": "sensor_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_type": { - "name": "sensor_wiki_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_phenomenon": { - "name": "sensor_wiki_phenomenon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_unit": { - "name": "sensor_wiki_unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "lastMeasurement": { - "name": "lastMeasurement", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "data": { - "name": "data", - "type": "json", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "sensor_device_id_device_id_fk": { - "name": "sensor_device_id_device_id_fk", - "tableFrom": "sensor", - "tableTo": "device", - "columnsFrom": [ - "device_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "unconfirmed_email": { - "name": "unconfirmed_email", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'user'" - }, - "language": { - "name": "language", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'en_US'" - }, - "email_is_confirmed": { - "name": "email_is_confirmed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "email_confirmation_token": { - "name": "email_confirmation_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "user_email_unique": { - "name": "user_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - }, - "user_unconfirmed_email_unique": { - "name": "user_unconfirmed_email_unique", - "nullsNotDistinct": false, - "columns": [ - "unconfirmed_email" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.location": { - "name": "location", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "location": { - "name": "location", - "type": "geometry(point)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "location_index": { - "name": "location_index", - "columns": [ - { - "expression": "location", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "location_location_unique": { - "name": "location_location_unique", - "nullsNotDistinct": false, - "columns": [ - "location" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.log_entry": { - "name": "log_entry", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.refresh_token": { - "name": "refresh_token", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "refresh_token_user_id_user_id_fk": { - "name": "refresh_token_user_id_user_id_fk", - "tableFrom": "refresh_token", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.token_revocation": { - "name": "token_revocation", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "json", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.access_token": { - "name": "access_token", - "schema": "", - "columns": { - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "access_token_device_id_device_id_fk": { - "name": "access_token_device_id_device_id_fk", - "tableFrom": "access_token", - "tableTo": "device", - "columnsFrom": [ - "device_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "public.exposure": { - "name": "exposure", - "schema": "public", - "values": [ - "indoor", - "outdoor", - "mobile", - "unknown" - ] - }, - "public.model": { - "name": "model", - "schema": "public", - "values": [ - "homeV2Lora", - "homeV2Ethernet", - "homeV2Wifi", - "senseBox:Edu", - "luftdaten.info", - "Custom" - ] - }, - "public.status": { - "name": "status", - "schema": "public", - "values": [ - "active", - "inactive", - "old" - ] - } - }, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": { - "public.measurement_10min": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_10min", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1day": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1day", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1hour": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1hour", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1month": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1month", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1year": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1year", - "schema": "public", - "isExisting": true, - "materialized": true - } - }, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/app/db/drizzle/meta/0022_snapshot.json b/app/db/drizzle/meta/0022_snapshot.json deleted file mode 100644 index 2437bf9a3..000000000 --- a/app/db/drizzle/meta/0022_snapshot.json +++ /dev/null @@ -1,1187 +0,0 @@ -{ - "id": "95fc2b5e-a6d7-426d-bfd8-7c5238f5722b", - "prevId": "85481101-dd0d-4e15-9158-11971b8ba509", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.device": { - "name": "device", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tags": { - "name": "tags", - "type": "text[]", - "primaryKey": false, - "notNull": false, - "default": "ARRAY[]::text[]" - }, - "link": { - "name": "link", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "use_auth": { - "name": "use_auth", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "exposure": { - "name": "exposure", - "type": "exposure", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "model": { - "name": "model", - "type": "model", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "date", - "primaryKey": false, - "notNull": false - }, - "latitude": { - "name": "latitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "longitude": { - "name": "longitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_model": { - "name": "sensor_wiki_model", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.device_to_location": { - "name": "device_to_location", - "schema": "", - "columns": { - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "location_id": { - "name": "location_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "device_to_location_device_id_device_id_fk": { - "name": "device_to_location_device_id_device_id_fk", - "tableFrom": "device_to_location", - "tableTo": "device", - "columnsFrom": ["device_id"], - "columnsTo": ["id"], - "onDelete": "cascade", - "onUpdate": "cascade" - }, - "device_to_location_location_id_location_id_fk": { - "name": "device_to_location_location_id_location_id_fk", - "tableFrom": "device_to_location", - "tableTo": "location", - "columnsFrom": ["location_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "device_to_location_device_id_location_id_time_pk": { - "name": "device_to_location_device_id_location_id_time_pk", - "columns": ["device_id", "location_id", "time"] - } - }, - "uniqueConstraints": { - "device_to_location_device_id_location_id_time_unique": { - "name": "device_to_location_device_id_location_id_time_unique", - "nullsNotDistinct": false, - "columns": ["device_id", "location_id", "time"] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.measurement": { - "name": "measurement", - "schema": "", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "location_id": { - "name": "location_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "measurement_location_id_location_id_fk": { - "name": "measurement_location_id_location_id_fk", - "tableFrom": "measurement", - "tableTo": "location", - "columnsFrom": ["location_id"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "measurement_sensor_id_time_unique": { - "name": "measurement_sensor_id_time_unique", - "nullsNotDistinct": false, - "columns": ["sensor_id", "time"] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.password": { - "name": "password", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "password_user_id_user_id_fk": { - "name": "password_user_id_user_id_fk", - "tableFrom": "password", - "tableTo": "user", - "columnsFrom": ["user_id"], - "columnsTo": ["id"], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.password_reset_request": { - "name": "password_reset_request", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "password_reset_request_user_id_user_id_fk": { - "name": "password_reset_request_user_id_user_id_fk", - "tableFrom": "password_reset_request", - "tableTo": "user", - "columnsFrom": ["user_id"], - "columnsTo": ["id"], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "password_reset_request_user_id_unique": { - "name": "password_reset_request_user_id_unique", - "nullsNotDistinct": false, - "columns": ["user_id"] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile": { - "name": "profile", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "username": { - "name": "username", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_user_id_user_id_fk": { - "name": "profile_user_id_user_id_fk", - "tableFrom": "profile", - "tableTo": "user", - "columnsFrom": ["user_id"], - "columnsTo": ["id"], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "profile_username_unique": { - "name": "profile_username_unique", - "nullsNotDistinct": false, - "columns": ["username"] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile_image": { - "name": "profile_image", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "alt_text": { - "name": "alt_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "content_type": { - "name": "content_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "blob": { - "name": "blob", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "profile_id": { - "name": "profile_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_image_profile_id_profile_id_fk": { - "name": "profile_image_profile_id_profile_id_fk", - "tableFrom": "profile_image", - "tableTo": "profile", - "columnsFrom": ["profile_id"], - "columnsTo": ["id"], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.sensor": { - "name": "sensor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_type": { - "name": "sensor_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_type": { - "name": "sensor_wiki_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_phenomenon": { - "name": "sensor_wiki_phenomenon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_unit": { - "name": "sensor_wiki_unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "lastMeasurement": { - "name": "lastMeasurement", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "data": { - "name": "data", - "type": "json", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "sensor_device_id_device_id_fk": { - "name": "sensor_device_id_device_id_fk", - "tableFrom": "sensor", - "tableTo": "device", - "columnsFrom": ["device_id"], - "columnsTo": ["id"], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "unconfirmed_email": { - "name": "unconfirmed_email", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'user'" - }, - "language": { - "name": "language", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'en_US'" - }, - "email_is_confirmed": { - "name": "email_is_confirmed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "email_confirmation_token": { - "name": "email_confirmation_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "user_email_unique": { - "name": "user_email_unique", - "nullsNotDistinct": false, - "columns": ["email"] - }, - "user_unconfirmed_email_unique": { - "name": "user_unconfirmed_email_unique", - "nullsNotDistinct": false, - "columns": ["unconfirmed_email"] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.location": { - "name": "location", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "location": { - "name": "location", - "type": "geometry(point)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "location_index": { - "name": "location_index", - "columns": [ - { - "expression": "location", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "location_location_unique": { - "name": "location_location_unique", - "nullsNotDistinct": false, - "columns": ["location"] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.log_entry": { - "name": "log_entry", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.refresh_token": { - "name": "refresh_token", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "refresh_token_user_id_user_id_fk": { - "name": "refresh_token_user_id_user_id_fk", - "tableFrom": "refresh_token", - "tableTo": "user", - "columnsFrom": ["user_id"], - "columnsTo": ["id"], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.token_revocation": { - "name": "token_revocation", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "json", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.claim": { - "name": "claim", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "box_id": { - "name": "box_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "claim_expires_at_idx": { - "name": "claim_expires_at_idx", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "claim_box_id_device_id_fk": { - "name": "claim_box_id_device_id_fk", - "tableFrom": "claim", - "tableTo": "device", - "columnsFrom": ["box_id"], - "columnsTo": ["id"], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "unique_box_id": { - "name": "unique_box_id", - "nullsNotDistinct": false, - "columns": ["box_id"] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.access_token": { - "name": "access_token", - "schema": "", - "columns": { - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "access_token_device_id_device_id_fk": { - "name": "access_token_device_id_device_id_fk", - "tableFrom": "access_token", - "tableTo": "device", - "columnsFrom": ["device_id"], - "columnsTo": ["id"], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "public.exposure": { - "name": "exposure", - "schema": "public", - "values": ["indoor", "outdoor", "mobile", "unknown"] - }, - "public.model": { - "name": "model", - "schema": "public", - "values": [ - "homeV2Lora", - "homeV2Ethernet", - "homeV2Wifi", - "senseBox:Edu", - "luftdaten.info", - "Custom" - ] - }, - "public.status": { - "name": "status", - "schema": "public", - "values": ["active", "inactive", "old"] - } - }, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": { - "public.measurement_10min": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_10min", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1day": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1day", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1hour": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1hour", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1month": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1month", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1year": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1year", - "schema": "public", - "isExisting": true, - "materialized": true - } - }, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} diff --git a/app/db/drizzle/meta/0023_snapshot.json b/app/db/drizzle/meta/0023_snapshot.json deleted file mode 100644 index 87b9b2ae2..000000000 --- a/app/db/drizzle/meta/0023_snapshot.json +++ /dev/null @@ -1,1187 +0,0 @@ -{ - "id": "b7903c96-4a1f-498b-abb4-07815b2d42d8", - "prevId": "95fc2b5e-a6d7-426d-bfd8-7c5238f5722b", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.device": { - "name": "device", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tags": { - "name": "tags", - "type": "text[]", - "primaryKey": false, - "notNull": false, - "default": "ARRAY[]::text[]" - }, - "link": { - "name": "link", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "use_auth": { - "name": "use_auth", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "exposure": { - "name": "exposure", - "type": "exposure", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "model": { - "name": "model", - "type": "model", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "date", - "primaryKey": false, - "notNull": false - }, - "latitude": { - "name": "latitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "longitude": { - "name": "longitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_model": { - "name": "sensor_wiki_model", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.device_to_location": { - "name": "device_to_location", - "schema": "", - "columns": { - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "location_id": { - "name": "location_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "device_to_location_device_id_device_id_fk": { - "name": "device_to_location_device_id_device_id_fk", - "tableFrom": "device_to_location", - "columnsFrom": ["device_id"], - "tableTo": "device", - "columnsTo": ["id"], - "onUpdate": "cascade", - "onDelete": "cascade" - }, - "device_to_location_location_id_location_id_fk": { - "name": "device_to_location_location_id_location_id_fk", - "tableFrom": "device_to_location", - "columnsFrom": ["location_id"], - "tableTo": "location", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": { - "device_to_location_device_id_location_id_time_pk": { - "name": "device_to_location_device_id_location_id_time_pk", - "columns": ["device_id", "location_id", "time"] - } - }, - "uniqueConstraints": { - "device_to_location_device_id_location_id_time_unique": { - "name": "device_to_location_device_id_location_id_time_unique", - "columns": ["device_id", "location_id", "time"], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.measurement": { - "name": "measurement", - "schema": "", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "location_id": { - "name": "location_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "measurement_location_id_location_id_fk": { - "name": "measurement_location_id_location_id_fk", - "tableFrom": "measurement", - "columnsFrom": ["location_id"], - "tableTo": "location", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "measurement_sensor_id_time_unique": { - "name": "measurement_sensor_id_time_unique", - "columns": ["sensor_id", "time"], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.password": { - "name": "password", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "password_user_id_user_id_fk": { - "name": "password_user_id_user_id_fk", - "tableFrom": "password", - "columnsFrom": ["user_id"], - "tableTo": "user", - "columnsTo": ["id"], - "onUpdate": "cascade", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.password_reset_request": { - "name": "password_reset_request", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "password_reset_request_user_id_user_id_fk": { - "name": "password_reset_request_user_id_user_id_fk", - "tableFrom": "password_reset_request", - "columnsFrom": ["user_id"], - "tableTo": "user", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "password_reset_request_user_id_unique": { - "name": "password_reset_request_user_id_unique", - "columns": ["user_id"], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile": { - "name": "profile", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "username": { - "name": "username", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_user_id_user_id_fk": { - "name": "profile_user_id_user_id_fk", - "tableFrom": "profile", - "columnsFrom": ["user_id"], - "tableTo": "user", - "columnsTo": ["id"], - "onUpdate": "cascade", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "profile_username_unique": { - "name": "profile_username_unique", - "columns": ["username"], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile_image": { - "name": "profile_image", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "alt_text": { - "name": "alt_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "content_type": { - "name": "content_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "blob": { - "name": "blob", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "profile_id": { - "name": "profile_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_image_profile_id_profile_id_fk": { - "name": "profile_image_profile_id_profile_id_fk", - "tableFrom": "profile_image", - "columnsFrom": ["profile_id"], - "tableTo": "profile", - "columnsTo": ["id"], - "onUpdate": "cascade", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.sensor": { - "name": "sensor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_type": { - "name": "sensor_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_type": { - "name": "sensor_wiki_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_phenomenon": { - "name": "sensor_wiki_phenomenon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_unit": { - "name": "sensor_wiki_unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "lastMeasurement": { - "name": "lastMeasurement", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "data": { - "name": "data", - "type": "json", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "sensor_device_id_device_id_fk": { - "name": "sensor_device_id_device_id_fk", - "tableFrom": "sensor", - "columnsFrom": ["device_id"], - "tableTo": "device", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "unconfirmed_email": { - "name": "unconfirmed_email", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'user'" - }, - "language": { - "name": "language", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'en_US'" - }, - "email_is_confirmed": { - "name": "email_is_confirmed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "email_confirmation_token": { - "name": "email_confirmation_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "user_email_unique": { - "name": "user_email_unique", - "columns": ["email"], - "nullsNotDistinct": false - }, - "user_unconfirmed_email_unique": { - "name": "user_unconfirmed_email_unique", - "columns": ["unconfirmed_email"], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.location": { - "name": "location", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "location": { - "name": "location", - "type": "geometry(point)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "location_index": { - "name": "location_index", - "columns": [ - { - "expression": "location", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "location_location_unique": { - "name": "location_location_unique", - "columns": ["location"], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.log_entry": { - "name": "log_entry", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.refresh_token": { - "name": "refresh_token", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "refresh_token_user_id_user_id_fk": { - "name": "refresh_token_user_id_user_id_fk", - "tableFrom": "refresh_token", - "columnsFrom": ["user_id"], - "tableTo": "user", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.token_revocation": { - "name": "token_revocation", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "json", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.claim": { - "name": "claim", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "box_id": { - "name": "box_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "claim_expires_at_idx": { - "name": "claim_expires_at_idx", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "claim_box_id_device_id_fk": { - "name": "claim_box_id_device_id_fk", - "tableFrom": "claim", - "columnsFrom": ["box_id"], - "tableTo": "device", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "unique_box_id": { - "name": "unique_box_id", - "columns": ["box_id"], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.access_token": { - "name": "access_token", - "schema": "", - "columns": { - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "access_token_device_id_device_id_fk": { - "name": "access_token_device_id_device_id_fk", - "tableFrom": "access_token", - "columnsFrom": ["device_id"], - "tableTo": "device", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "public.exposure": { - "name": "exposure", - "schema": "public", - "values": ["indoor", "outdoor", "mobile", "unknown"] - }, - "public.model": { - "name": "model", - "schema": "public", - "values": [ - "homeV2Lora", - "homeV2Ethernet", - "homeV2Wifi", - "senseBox:Edu", - "luftdaten.info", - "Custom" - ] - }, - "public.status": { - "name": "status", - "schema": "public", - "values": ["active", "inactive", "old"] - } - }, - "schemas": {}, - "views": { - "public.measurement_10min": { - "name": "measurement_10min", - "schema": "public", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "materialized": true, - "isExisting": true - }, - "public.measurement_1day": { - "name": "measurement_1day", - "schema": "public", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "materialized": true, - "isExisting": true - }, - "public.measurement_1hour": { - "name": "measurement_1hour", - "schema": "public", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "materialized": true, - "isExisting": true - }, - "public.measurement_1month": { - "name": "measurement_1month", - "schema": "public", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "materialized": true, - "isExisting": true - }, - "public.measurement_1year": { - "name": "measurement_1year", - "schema": "public", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "materialized": true, - "isExisting": true - } - }, - "sequences": {}, - "roles": {}, - "policies": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} diff --git a/app/db/drizzle/meta/0024_snapshot.json b/app/db/drizzle/meta/0024_snapshot.json deleted file mode 100644 index a4eb13929..000000000 --- a/app/db/drizzle/meta/0024_snapshot.json +++ /dev/null @@ -1,1279 +0,0 @@ -{ - "id": "be35aeec-1a4d-449f-bbe9-b290b6a79093", - "prevId": "b7903c96-4a1f-498b-abb4-07815b2d42d8", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.device": { - "name": "device", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tags": { - "name": "tags", - "type": "text[]", - "primaryKey": false, - "notNull": false, - "default": "ARRAY[]::text[]" - }, - "link": { - "name": "link", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "use_auth": { - "name": "use_auth", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "exposure": { - "name": "exposure", - "type": "exposure", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "model": { - "name": "model", - "type": "model", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "date", - "primaryKey": false, - "notNull": false - }, - "latitude": { - "name": "latitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "longitude": { - "name": "longitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_model": { - "name": "sensor_wiki_model", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.device_to_location": { - "name": "device_to_location", - "schema": "", - "columns": { - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "location_id": { - "name": "location_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "device_to_location_device_id_device_id_fk": { - "name": "device_to_location_device_id_device_id_fk", - "tableFrom": "device_to_location", - "tableTo": "device", - "columnsFrom": [ - "device_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - }, - "device_to_location_location_id_location_id_fk": { - "name": "device_to_location_location_id_location_id_fk", - "tableFrom": "device_to_location", - "tableTo": "location", - "columnsFrom": [ - "location_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "device_to_location_device_id_location_id_time_pk": { - "name": "device_to_location_device_id_location_id_time_pk", - "columns": [ - "device_id", - "location_id", - "time" - ] - } - }, - "uniqueConstraints": { - "device_to_location_device_id_location_id_time_unique": { - "name": "device_to_location_device_id_location_id_time_unique", - "nullsNotDistinct": false, - "columns": [ - "device_id", - "location_id", - "time" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.measurement": { - "name": "measurement", - "schema": "", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "location_id": { - "name": "location_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "measurement_location_id_location_id_fk": { - "name": "measurement_location_id_location_id_fk", - "tableFrom": "measurement", - "tableTo": "location", - "columnsFrom": [ - "location_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "measurement_sensor_id_time_unique": { - "name": "measurement_sensor_id_time_unique", - "nullsNotDistinct": false, - "columns": [ - "sensor_id", - "time" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.password": { - "name": "password", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "password_user_id_user_id_fk": { - "name": "password_user_id_user_id_fk", - "tableFrom": "password", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.password_reset_request": { - "name": "password_reset_request", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "password_reset_request_user_id_user_id_fk": { - "name": "password_reset_request_user_id_user_id_fk", - "tableFrom": "password_reset_request", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "password_reset_request_user_id_unique": { - "name": "password_reset_request_user_id_unique", - "nullsNotDistinct": false, - "columns": [ - "user_id" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile": { - "name": "profile", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "username": { - "name": "username", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_user_id_user_id_fk": { - "name": "profile_user_id_user_id_fk", - "tableFrom": "profile", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "profile_username_unique": { - "name": "profile_username_unique", - "nullsNotDistinct": false, - "columns": [ - "username" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile_image": { - "name": "profile_image", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "alt_text": { - "name": "alt_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "content_type": { - "name": "content_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "blob": { - "name": "blob", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "profile_id": { - "name": "profile_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_image_profile_id_profile_id_fk": { - "name": "profile_image_profile_id_profile_id_fk", - "tableFrom": "profile_image", - "tableTo": "profile", - "columnsFrom": [ - "profile_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.sensor": { - "name": "sensor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_type": { - "name": "sensor_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_type": { - "name": "sensor_wiki_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_phenomenon": { - "name": "sensor_wiki_phenomenon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_unit": { - "name": "sensor_wiki_unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "lastMeasurement": { - "name": "lastMeasurement", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "data": { - "name": "data", - "type": "json", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "sensor_device_id_device_id_fk": { - "name": "sensor_device_id_device_id_fk", - "tableFrom": "sensor", - "tableTo": "device", - "columnsFrom": [ - "device_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "unconfirmed_email": { - "name": "unconfirmed_email", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'user'" - }, - "language": { - "name": "language", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'en_US'" - }, - "email_is_confirmed": { - "name": "email_is_confirmed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "email_confirmation_token": { - "name": "email_confirmation_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "user_email_unique": { - "name": "user_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - }, - "user_unconfirmed_email_unique": { - "name": "user_unconfirmed_email_unique", - "nullsNotDistinct": false, - "columns": [ - "unconfirmed_email" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.location": { - "name": "location", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "location": { - "name": "location", - "type": "geometry(point)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "location_index": { - "name": "location_index", - "columns": [ - { - "expression": "location", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "location_location_unique": { - "name": "location_location_unique", - "nullsNotDistinct": false, - "columns": [ - "location" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.log_entry": { - "name": "log_entry", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.refresh_token": { - "name": "refresh_token", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "refresh_token_user_id_user_id_fk": { - "name": "refresh_token_user_id_user_id_fk", - "tableFrom": "refresh_token", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.token_revocation": { - "name": "token_revocation", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "json", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.claim": { - "name": "claim", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "box_id": { - "name": "box_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "claim_expires_at_idx": { - "name": "claim_expires_at_idx", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "claim_box_id_device_id_fk": { - "name": "claim_box_id_device_id_fk", - "tableFrom": "claim", - "tableTo": "device", - "columnsFrom": [ - "box_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "unique_box_id": { - "name": "unique_box_id", - "nullsNotDistinct": false, - "columns": [ - "box_id" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.access_token": { - "name": "access_token", - "schema": "", - "columns": { - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "access_token_device_id_device_id_fk": { - "name": "access_token_device_id_device_id_fk", - "tableFrom": "access_token", - "tableTo": "device", - "columnsFrom": [ - "device_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "public.exposure": { - "name": "exposure", - "schema": "public", - "values": [ - "indoor", - "outdoor", - "mobile", - "unknown" - ] - }, - "public.model": { - "name": "model", - "schema": "public", - "values": [ - "homeV2Lora", - "homeV2Ethernet", - "homeV2Wifi", - "homeEthernet", - "homeWifi", - "homeEthernetFeinstaub", - "homeWifiFeinstaub", - "luftdaten_sds011", - "luftdaten_sds011_dht11", - "luftdaten_sds011_dht22", - "luftdaten_sds011_bmp180", - "luftdaten_sds011_bme280", - "hackair_home_v2", - "senseBox:Edu", - "luftdaten.info", - "Custom" - ] - }, - "public.status": { - "name": "status", - "schema": "public", - "values": [ - "active", - "inactive", - "old" - ] - } - }, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": { - "public.measurement_10min": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_10min", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1day": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1day", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1hour": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1hour", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1month": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1month", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1year": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1year", - "schema": "public", - "isExisting": true, - "materialized": true - } - }, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/app/db/drizzle/meta/0025_snapshot.json b/app/db/drizzle/meta/0025_snapshot.json deleted file mode 100644 index a68ae63d9..000000000 --- a/app/db/drizzle/meta/0025_snapshot.json +++ /dev/null @@ -1,1279 +0,0 @@ -{ - "id": "8290e5ac-6df5-43de-99c2-23b42d7ba33e", - "prevId": "be35aeec-1a4d-449f-bbe9-b290b6a79093", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.device": { - "name": "device", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tags": { - "name": "tags", - "type": "text[]", - "primaryKey": false, - "notNull": false, - "default": "ARRAY[]::text[]" - }, - "link": { - "name": "link", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "use_auth": { - "name": "use_auth", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "exposure": { - "name": "exposure", - "type": "exposure", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "model": { - "name": "model", - "type": "model", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "date", - "primaryKey": false, - "notNull": false - }, - "latitude": { - "name": "latitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "longitude": { - "name": "longitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_model": { - "name": "sensor_wiki_model", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.device_to_location": { - "name": "device_to_location", - "schema": "", - "columns": { - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "location_id": { - "name": "location_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "device_to_location_device_id_device_id_fk": { - "name": "device_to_location_device_id_device_id_fk", - "tableFrom": "device_to_location", - "columnsFrom": [ - "device_id" - ], - "tableTo": "device", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "cascade" - }, - "device_to_location_location_id_location_id_fk": { - "name": "device_to_location_location_id_location_id_fk", - "tableFrom": "device_to_location", - "columnsFrom": [ - "location_id" - ], - "tableTo": "location", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": { - "device_to_location_device_id_location_id_time_pk": { - "name": "device_to_location_device_id_location_id_time_pk", - "columns": [ - "device_id", - "location_id", - "time" - ] - } - }, - "uniqueConstraints": { - "device_to_location_device_id_location_id_time_unique": { - "name": "device_to_location_device_id_location_id_time_unique", - "columns": [ - "device_id", - "location_id", - "time" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.measurement": { - "name": "measurement", - "schema": "", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "location_id": { - "name": "location_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "measurement_location_id_location_id_fk": { - "name": "measurement_location_id_location_id_fk", - "tableFrom": "measurement", - "columnsFrom": [ - "location_id" - ], - "tableTo": "location", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "measurement_sensor_id_time_unique": { - "name": "measurement_sensor_id_time_unique", - "columns": [ - "sensor_id", - "time" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.password": { - "name": "password", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "password_user_id_user_id_fk": { - "name": "password_user_id_user_id_fk", - "tableFrom": "password", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.password_reset_request": { - "name": "password_reset_request", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "password_reset_request_user_id_user_id_fk": { - "name": "password_reset_request_user_id_user_id_fk", - "tableFrom": "password_reset_request", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "password_reset_request_user_id_unique": { - "name": "password_reset_request_user_id_unique", - "columns": [ - "user_id" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile": { - "name": "profile", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "username": { - "name": "username", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_user_id_user_id_fk": { - "name": "profile_user_id_user_id_fk", - "tableFrom": "profile", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "profile_username_unique": { - "name": "profile_username_unique", - "columns": [ - "username" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile_image": { - "name": "profile_image", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "alt_text": { - "name": "alt_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "content_type": { - "name": "content_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "blob": { - "name": "blob", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "profile_id": { - "name": "profile_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_image_profile_id_profile_id_fk": { - "name": "profile_image_profile_id_profile_id_fk", - "tableFrom": "profile_image", - "columnsFrom": [ - "profile_id" - ], - "tableTo": "profile", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.sensor": { - "name": "sensor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_type": { - "name": "sensor_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_type": { - "name": "sensor_wiki_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_phenomenon": { - "name": "sensor_wiki_phenomenon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_unit": { - "name": "sensor_wiki_unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "lastMeasurement": { - "name": "lastMeasurement", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "data": { - "name": "data", - "type": "json", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "sensor_device_id_device_id_fk": { - "name": "sensor_device_id_device_id_fk", - "tableFrom": "sensor", - "columnsFrom": [ - "device_id" - ], - "tableTo": "device", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "unconfirmed_email": { - "name": "unconfirmed_email", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'user'" - }, - "language": { - "name": "language", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'en_US'" - }, - "email_is_confirmed": { - "name": "email_is_confirmed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "email_confirmation_token": { - "name": "email_confirmation_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "user_email_unique": { - "name": "user_email_unique", - "columns": [ - "email" - ], - "nullsNotDistinct": false - }, - "user_unconfirmed_email_unique": { - "name": "user_unconfirmed_email_unique", - "columns": [ - "unconfirmed_email" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.location": { - "name": "location", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "location": { - "name": "location", - "type": "geometry(point)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "location_index": { - "name": "location_index", - "columns": [ - { - "expression": "location", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "location_location_unique": { - "name": "location_location_unique", - "columns": [ - "location" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.log_entry": { - "name": "log_entry", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.refresh_token": { - "name": "refresh_token", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "refresh_token_user_id_user_id_fk": { - "name": "refresh_token_user_id_user_id_fk", - "tableFrom": "refresh_token", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.token_revocation": { - "name": "token_revocation", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "json", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.claim": { - "name": "claim", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "box_id": { - "name": "box_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "claim_expires_at_idx": { - "name": "claim_expires_at_idx", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "claim_box_id_device_id_fk": { - "name": "claim_box_id_device_id_fk", - "tableFrom": "claim", - "columnsFrom": [ - "box_id" - ], - "tableTo": "device", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "unique_box_id": { - "name": "unique_box_id", - "columns": [ - "box_id" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.access_token": { - "name": "access_token", - "schema": "", - "columns": { - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "access_token_device_id_device_id_fk": { - "name": "access_token_device_id_device_id_fk", - "tableFrom": "access_token", - "columnsFrom": [ - "device_id" - ], - "tableTo": "device", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "public.exposure": { - "name": "exposure", - "schema": "public", - "values": [ - "indoor", - "outdoor", - "mobile", - "unknown" - ] - }, - "public.model": { - "name": "model", - "schema": "public", - "values": [ - "homeV2Lora", - "homeV2Ethernet", - "homeV2Wifi", - "homeEthernet", - "homeWifi", - "homeEthernetFeinstaub", - "homeWifiFeinstaub", - "luftdaten_sds011", - "luftdaten_sds011_dht11", - "luftdaten_sds011_dht22", - "luftdaten_sds011_bmp180", - "luftdaten_sds011_bme280", - "hackair_home_v2", - "senseBox:Edu", - "luftdaten.info", - "Custom" - ] - }, - "public.status": { - "name": "status", - "schema": "public", - "values": [ - "active", - "inactive", - "old" - ] - } - }, - "schemas": {}, - "views": { - "public.measurement_10min": { - "name": "measurement_10min", - "schema": "public", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "materialized": true, - "isExisting": true - }, - "public.measurement_1day": { - "name": "measurement_1day", - "schema": "public", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "materialized": true, - "isExisting": true - }, - "public.measurement_1hour": { - "name": "measurement_1hour", - "schema": "public", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "materialized": true, - "isExisting": true - }, - "public.measurement_1month": { - "name": "measurement_1month", - "schema": "public", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "materialized": true, - "isExisting": true - }, - "public.measurement_1year": { - "name": "measurement_1year", - "schema": "public", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "materialized": true, - "isExisting": true - } - }, - "sequences": {}, - "roles": {}, - "policies": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/app/db/drizzle/meta/0026_snapshot.json b/app/db/drizzle/meta/0026_snapshot.json deleted file mode 100644 index 07c9bed74..000000000 --- a/app/db/drizzle/meta/0026_snapshot.json +++ /dev/null @@ -1,1285 +0,0 @@ -{ - "id": "705f9077-6082-45cc-b539-3dab19aae432", - "prevId": "8290e5ac-6df5-43de-99c2-23b42d7ba33e", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.device": { - "name": "device", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "website": { - "name": "website", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tags": { - "name": "tags", - "type": "text[]", - "primaryKey": false, - "notNull": false, - "default": "ARRAY[]::text[]" - }, - "link": { - "name": "link", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "use_auth": { - "name": "use_auth", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "exposure": { - "name": "exposure", - "type": "exposure", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "model": { - "name": "model", - "type": "model", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "date", - "primaryKey": false, - "notNull": false - }, - "latitude": { - "name": "latitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "longitude": { - "name": "longitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_model": { - "name": "sensor_wiki_model", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.device_to_location": { - "name": "device_to_location", - "schema": "", - "columns": { - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "location_id": { - "name": "location_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "device_to_location_device_id_device_id_fk": { - "name": "device_to_location_device_id_device_id_fk", - "tableFrom": "device_to_location", - "tableTo": "device", - "columnsFrom": [ - "device_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - }, - "device_to_location_location_id_location_id_fk": { - "name": "device_to_location_location_id_location_id_fk", - "tableFrom": "device_to_location", - "tableTo": "location", - "columnsFrom": [ - "location_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "device_to_location_device_id_location_id_time_pk": { - "name": "device_to_location_device_id_location_id_time_pk", - "columns": [ - "device_id", - "location_id", - "time" - ] - } - }, - "uniqueConstraints": { - "device_to_location_device_id_location_id_time_unique": { - "name": "device_to_location_device_id_location_id_time_unique", - "nullsNotDistinct": false, - "columns": [ - "device_id", - "location_id", - "time" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.measurement": { - "name": "measurement", - "schema": "", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "location_id": { - "name": "location_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "measurement_location_id_location_id_fk": { - "name": "measurement_location_id_location_id_fk", - "tableFrom": "measurement", - "tableTo": "location", - "columnsFrom": [ - "location_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "measurement_sensor_id_time_unique": { - "name": "measurement_sensor_id_time_unique", - "nullsNotDistinct": false, - "columns": [ - "sensor_id", - "time" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.password": { - "name": "password", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "password_user_id_user_id_fk": { - "name": "password_user_id_user_id_fk", - "tableFrom": "password", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.password_reset_request": { - "name": "password_reset_request", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "password_reset_request_user_id_user_id_fk": { - "name": "password_reset_request_user_id_user_id_fk", - "tableFrom": "password_reset_request", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "password_reset_request_user_id_unique": { - "name": "password_reset_request_user_id_unique", - "nullsNotDistinct": false, - "columns": [ - "user_id" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile": { - "name": "profile", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "username": { - "name": "username", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_user_id_user_id_fk": { - "name": "profile_user_id_user_id_fk", - "tableFrom": "profile", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "profile_username_unique": { - "name": "profile_username_unique", - "nullsNotDistinct": false, - "columns": [ - "username" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile_image": { - "name": "profile_image", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "alt_text": { - "name": "alt_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "content_type": { - "name": "content_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "blob": { - "name": "blob", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "profile_id": { - "name": "profile_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_image_profile_id_profile_id_fk": { - "name": "profile_image_profile_id_profile_id_fk", - "tableFrom": "profile_image", - "tableTo": "profile", - "columnsFrom": [ - "profile_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.sensor": { - "name": "sensor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_type": { - "name": "sensor_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_type": { - "name": "sensor_wiki_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_phenomenon": { - "name": "sensor_wiki_phenomenon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_unit": { - "name": "sensor_wiki_unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "lastMeasurement": { - "name": "lastMeasurement", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "data": { - "name": "data", - "type": "json", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "sensor_device_id_device_id_fk": { - "name": "sensor_device_id_device_id_fk", - "tableFrom": "sensor", - "tableTo": "device", - "columnsFrom": [ - "device_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "unconfirmed_email": { - "name": "unconfirmed_email", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'user'" - }, - "language": { - "name": "language", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'en_US'" - }, - "email_is_confirmed": { - "name": "email_is_confirmed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "email_confirmation_token": { - "name": "email_confirmation_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "user_email_unique": { - "name": "user_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - }, - "user_unconfirmed_email_unique": { - "name": "user_unconfirmed_email_unique", - "nullsNotDistinct": false, - "columns": [ - "unconfirmed_email" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.location": { - "name": "location", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "location": { - "name": "location", - "type": "geometry(point)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "location_index": { - "name": "location_index", - "columns": [ - { - "expression": "location", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "location_location_unique": { - "name": "location_location_unique", - "nullsNotDistinct": false, - "columns": [ - "location" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.log_entry": { - "name": "log_entry", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.refresh_token": { - "name": "refresh_token", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "refresh_token_user_id_user_id_fk": { - "name": "refresh_token_user_id_user_id_fk", - "tableFrom": "refresh_token", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.token_revocation": { - "name": "token_revocation", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "json", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.claim": { - "name": "claim", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "box_id": { - "name": "box_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "claim_expires_at_idx": { - "name": "claim_expires_at_idx", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "claim_box_id_device_id_fk": { - "name": "claim_box_id_device_id_fk", - "tableFrom": "claim", - "tableTo": "device", - "columnsFrom": [ - "box_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "unique_box_id": { - "name": "unique_box_id", - "nullsNotDistinct": false, - "columns": [ - "box_id" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.access_token": { - "name": "access_token", - "schema": "", - "columns": { - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "access_token_device_id_device_id_fk": { - "name": "access_token_device_id_device_id_fk", - "tableFrom": "access_token", - "tableTo": "device", - "columnsFrom": [ - "device_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "public.exposure": { - "name": "exposure", - "schema": "public", - "values": [ - "indoor", - "outdoor", - "mobile", - "unknown" - ] - }, - "public.model": { - "name": "model", - "schema": "public", - "values": [ - "homeV2Lora", - "homeV2Ethernet", - "homeV2Wifi", - "homeEthernet", - "homeWifi", - "homeEthernetFeinstaub", - "homeWifiFeinstaub", - "luftdaten_sds011", - "luftdaten_sds011_dht11", - "luftdaten_sds011_dht22", - "luftdaten_sds011_bmp180", - "luftdaten_sds011_bme280", - "hackair_home_v2", - "senseBox:Edu", - "luftdaten.info", - "Custom" - ] - }, - "public.status": { - "name": "status", - "schema": "public", - "values": [ - "active", - "inactive", - "old" - ] - } - }, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": { - "public.measurement_10min": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_10min", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1day": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1day", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1hour": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1hour", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1month": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1month", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1year": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1year", - "schema": "public", - "isExisting": true, - "materialized": true - } - }, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/app/db/drizzle/meta/0027_snapshot.json b/app/db/drizzle/meta/0027_snapshot.json deleted file mode 100644 index ce8866316..000000000 --- a/app/db/drizzle/meta/0027_snapshot.json +++ /dev/null @@ -1,1285 +0,0 @@ -{ - "id": "5143b70f-657d-4617-af40-c0234803f6ee", - "prevId": "705f9077-6082-45cc-b539-3dab19aae432", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.device": { - "name": "device", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "website": { - "name": "website", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tags": { - "name": "tags", - "type": "text[]", - "primaryKey": false, - "notNull": false, - "default": "ARRAY[]::text[]" - }, - "link": { - "name": "link", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "use_auth": { - "name": "use_auth", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "exposure": { - "name": "exposure", - "type": "exposure", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "model": { - "name": "model", - "type": "model", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "date", - "primaryKey": false, - "notNull": false - }, - "latitude": { - "name": "latitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "longitude": { - "name": "longitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_model": { - "name": "sensor_wiki_model", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.device_to_location": { - "name": "device_to_location", - "schema": "", - "columns": { - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "location_id": { - "name": "location_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "device_to_location_device_id_device_id_fk": { - "name": "device_to_location_device_id_device_id_fk", - "tableFrom": "device_to_location", - "tableTo": "device", - "columnsFrom": [ - "device_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - }, - "device_to_location_location_id_location_id_fk": { - "name": "device_to_location_location_id_location_id_fk", - "tableFrom": "device_to_location", - "tableTo": "location", - "columnsFrom": [ - "location_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "device_to_location_device_id_location_id_time_pk": { - "name": "device_to_location_device_id_location_id_time_pk", - "columns": [ - "device_id", - "location_id", - "time" - ] - } - }, - "uniqueConstraints": { - "device_to_location_device_id_location_id_time_unique": { - "name": "device_to_location_device_id_location_id_time_unique", - "nullsNotDistinct": false, - "columns": [ - "device_id", - "location_id", - "time" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.measurement": { - "name": "measurement", - "schema": "", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "location_id": { - "name": "location_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "measurement_location_id_location_id_fk": { - "name": "measurement_location_id_location_id_fk", - "tableFrom": "measurement", - "tableTo": "location", - "columnsFrom": [ - "location_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "measurement_sensor_id_time_unique": { - "name": "measurement_sensor_id_time_unique", - "nullsNotDistinct": false, - "columns": [ - "sensor_id", - "time" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.password": { - "name": "password", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "password_user_id_user_id_fk": { - "name": "password_user_id_user_id_fk", - "tableFrom": "password", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.password_reset_request": { - "name": "password_reset_request", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "password_reset_request_user_id_user_id_fk": { - "name": "password_reset_request_user_id_user_id_fk", - "tableFrom": "password_reset_request", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "password_reset_request_user_id_unique": { - "name": "password_reset_request_user_id_unique", - "nullsNotDistinct": false, - "columns": [ - "user_id" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile": { - "name": "profile", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "username": { - "name": "username", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_user_id_user_id_fk": { - "name": "profile_user_id_user_id_fk", - "tableFrom": "profile", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "profile_username_unique": { - "name": "profile_username_unique", - "nullsNotDistinct": false, - "columns": [ - "username" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile_image": { - "name": "profile_image", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "alt_text": { - "name": "alt_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "content_type": { - "name": "content_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "blob": { - "name": "blob", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "profile_id": { - "name": "profile_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_image_profile_id_profile_id_fk": { - "name": "profile_image_profile_id_profile_id_fk", - "tableFrom": "profile_image", - "tableTo": "profile", - "columnsFrom": [ - "profile_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.sensor": { - "name": "sensor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_type": { - "name": "sensor_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_type": { - "name": "sensor_wiki_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_phenomenon": { - "name": "sensor_wiki_phenomenon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_unit": { - "name": "sensor_wiki_unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "lastMeasurement": { - "name": "lastMeasurement", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "data": { - "name": "data", - "type": "json", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "sensor_device_id_device_id_fk": { - "name": "sensor_device_id_device_id_fk", - "tableFrom": "sensor", - "tableTo": "device", - "columnsFrom": [ - "device_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "unconfirmed_email": { - "name": "unconfirmed_email", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'user'" - }, - "language": { - "name": "language", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'en_US'" - }, - "email_is_confirmed": { - "name": "email_is_confirmed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "email_confirmation_token": { - "name": "email_confirmation_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "user_email_unique": { - "name": "user_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - }, - "user_unconfirmed_email_unique": { - "name": "user_unconfirmed_email_unique", - "nullsNotDistinct": false, - "columns": [ - "unconfirmed_email" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.location": { - "name": "location", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "location": { - "name": "location", - "type": "geometry(point)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "location_index": { - "name": "location_index", - "columns": [ - { - "expression": "location", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "location_location_unique": { - "name": "location_location_unique", - "nullsNotDistinct": false, - "columns": [ - "location" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.log_entry": { - "name": "log_entry", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.refresh_token": { - "name": "refresh_token", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "refresh_token_user_id_user_id_fk": { - "name": "refresh_token_user_id_user_id_fk", - "tableFrom": "refresh_token", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.token_revocation": { - "name": "token_revocation", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "json", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.claim": { - "name": "claim", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "box_id": { - "name": "box_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "claim_expires_at_idx": { - "name": "claim_expires_at_idx", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "claim_box_id_device_id_fk": { - "name": "claim_box_id_device_id_fk", - "tableFrom": "claim", - "tableTo": "device", - "columnsFrom": [ - "box_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "unique_box_id": { - "name": "unique_box_id", - "nullsNotDistinct": false, - "columns": [ - "box_id" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.access_token": { - "name": "access_token", - "schema": "", - "columns": { - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "access_token_device_id_device_id_fk": { - "name": "access_token_device_id_device_id_fk", - "tableFrom": "access_token", - "tableTo": "device", - "columnsFrom": [ - "device_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "public.exposure": { - "name": "exposure", - "schema": "public", - "values": [ - "indoor", - "outdoor", - "mobile", - "unknown" - ] - }, - "public.model": { - "name": "model", - "schema": "public", - "values": [ - "homeV2Lora", - "homeV2Ethernet", - "homeV2Wifi", - "homeEthernet", - "homeWifi", - "homeEthernetFeinstaub", - "homeWifiFeinstaub", - "luftdaten_sds011", - "luftdaten_sds011_dht11", - "luftdaten_sds011_dht22", - "luftdaten_sds011_bmp180", - "luftdaten_sds011_bme280", - "hackair_home_v2", - "senseBox:Edu", - "luftdaten.info", - "custom" - ] - }, - "public.status": { - "name": "status", - "schema": "public", - "values": [ - "active", - "inactive", - "old" - ] - } - }, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": { - "public.measurement_10min": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_10min", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1day": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1day", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1hour": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1hour", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1month": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1month", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1year": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1year", - "schema": "public", - "isExisting": true, - "materialized": true - } - }, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/app/db/drizzle/meta/0028_snapshot.json b/app/db/drizzle/meta/0028_snapshot.json deleted file mode 100644 index e3a3f6a02..000000000 --- a/app/db/drizzle/meta/0028_snapshot.json +++ /dev/null @@ -1,1286 +0,0 @@ -{ - "id": "d622d4a4-5722-4b7f-b22f-8c5184ad7148", - "prevId": "5143b70f-657d-4617-af40-c0234803f6ee", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.device": { - "name": "device", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "website": { - "name": "website", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tags": { - "name": "tags", - "type": "text[]", - "primaryKey": false, - "notNull": false, - "default": "ARRAY[]::text[]" - }, - "link": { - "name": "link", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "use_auth": { - "name": "use_auth", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "exposure": { - "name": "exposure", - "type": "exposure", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "model": { - "name": "model", - "type": "model", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'custom'" - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "date", - "primaryKey": false, - "notNull": false - }, - "latitude": { - "name": "latitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "longitude": { - "name": "longitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_model": { - "name": "sensor_wiki_model", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.device_to_location": { - "name": "device_to_location", - "schema": "", - "columns": { - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "location_id": { - "name": "location_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "device_to_location_device_id_device_id_fk": { - "name": "device_to_location_device_id_device_id_fk", - "tableFrom": "device_to_location", - "tableTo": "device", - "columnsFrom": [ - "device_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - }, - "device_to_location_location_id_location_id_fk": { - "name": "device_to_location_location_id_location_id_fk", - "tableFrom": "device_to_location", - "tableTo": "location", - "columnsFrom": [ - "location_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "device_to_location_device_id_location_id_time_pk": { - "name": "device_to_location_device_id_location_id_time_pk", - "columns": [ - "device_id", - "location_id", - "time" - ] - } - }, - "uniqueConstraints": { - "device_to_location_device_id_location_id_time_unique": { - "name": "device_to_location_device_id_location_id_time_unique", - "nullsNotDistinct": false, - "columns": [ - "device_id", - "location_id", - "time" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.measurement": { - "name": "measurement", - "schema": "", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "location_id": { - "name": "location_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "measurement_location_id_location_id_fk": { - "name": "measurement_location_id_location_id_fk", - "tableFrom": "measurement", - "tableTo": "location", - "columnsFrom": [ - "location_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "measurement_sensor_id_time_unique": { - "name": "measurement_sensor_id_time_unique", - "nullsNotDistinct": false, - "columns": [ - "sensor_id", - "time" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.password": { - "name": "password", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "password_user_id_user_id_fk": { - "name": "password_user_id_user_id_fk", - "tableFrom": "password", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.password_reset_request": { - "name": "password_reset_request", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "password_reset_request_user_id_user_id_fk": { - "name": "password_reset_request_user_id_user_id_fk", - "tableFrom": "password_reset_request", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "password_reset_request_user_id_unique": { - "name": "password_reset_request_user_id_unique", - "nullsNotDistinct": false, - "columns": [ - "user_id" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile": { - "name": "profile", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "username": { - "name": "username", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_user_id_user_id_fk": { - "name": "profile_user_id_user_id_fk", - "tableFrom": "profile", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "profile_username_unique": { - "name": "profile_username_unique", - "nullsNotDistinct": false, - "columns": [ - "username" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile_image": { - "name": "profile_image", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "alt_text": { - "name": "alt_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "content_type": { - "name": "content_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "blob": { - "name": "blob", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "profile_id": { - "name": "profile_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_image_profile_id_profile_id_fk": { - "name": "profile_image_profile_id_profile_id_fk", - "tableFrom": "profile_image", - "tableTo": "profile", - "columnsFrom": [ - "profile_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.sensor": { - "name": "sensor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_type": { - "name": "sensor_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_type": { - "name": "sensor_wiki_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_phenomenon": { - "name": "sensor_wiki_phenomenon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_unit": { - "name": "sensor_wiki_unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "lastMeasurement": { - "name": "lastMeasurement", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "data": { - "name": "data", - "type": "json", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "sensor_device_id_device_id_fk": { - "name": "sensor_device_id_device_id_fk", - "tableFrom": "sensor", - "tableTo": "device", - "columnsFrom": [ - "device_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "unconfirmed_email": { - "name": "unconfirmed_email", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'user'" - }, - "language": { - "name": "language", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'en_US'" - }, - "email_is_confirmed": { - "name": "email_is_confirmed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "email_confirmation_token": { - "name": "email_confirmation_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "user_email_unique": { - "name": "user_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - }, - "user_unconfirmed_email_unique": { - "name": "user_unconfirmed_email_unique", - "nullsNotDistinct": false, - "columns": [ - "unconfirmed_email" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.location": { - "name": "location", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "location": { - "name": "location", - "type": "geometry(point)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "location_index": { - "name": "location_index", - "columns": [ - { - "expression": "location", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "location_location_unique": { - "name": "location_location_unique", - "nullsNotDistinct": false, - "columns": [ - "location" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.log_entry": { - "name": "log_entry", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.refresh_token": { - "name": "refresh_token", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "refresh_token_user_id_user_id_fk": { - "name": "refresh_token_user_id_user_id_fk", - "tableFrom": "refresh_token", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.token_revocation": { - "name": "token_revocation", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "json", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.claim": { - "name": "claim", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "box_id": { - "name": "box_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "claim_expires_at_idx": { - "name": "claim_expires_at_idx", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "claim_box_id_device_id_fk": { - "name": "claim_box_id_device_id_fk", - "tableFrom": "claim", - "tableTo": "device", - "columnsFrom": [ - "box_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "unique_box_id": { - "name": "unique_box_id", - "nullsNotDistinct": false, - "columns": [ - "box_id" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.access_token": { - "name": "access_token", - "schema": "", - "columns": { - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "access_token_device_id_device_id_fk": { - "name": "access_token_device_id_device_id_fk", - "tableFrom": "access_token", - "tableTo": "device", - "columnsFrom": [ - "device_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "public.exposure": { - "name": "exposure", - "schema": "public", - "values": [ - "indoor", - "outdoor", - "mobile", - "unknown" - ] - }, - "public.model": { - "name": "model", - "schema": "public", - "values": [ - "homeV2Lora", - "homeV2Ethernet", - "homeV2Wifi", - "homeEthernet", - "homeWifi", - "homeEthernetFeinstaub", - "homeWifiFeinstaub", - "luftdaten_sds011", - "luftdaten_sds011_dht11", - "luftdaten_sds011_dht22", - "luftdaten_sds011_bmp180", - "luftdaten_sds011_bme280", - "hackair_home_v2", - "senseBox:Edu", - "luftdaten.info", - "custom" - ] - }, - "public.status": { - "name": "status", - "schema": "public", - "values": [ - "active", - "inactive", - "old" - ] - } - }, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": { - "public.measurement_10min": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_10min", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1day": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1day", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1hour": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1hour", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1month": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1month", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1year": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1year", - "schema": "public", - "isExisting": true, - "materialized": true - } - }, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/app/db/drizzle/meta/0029_snapshot.json b/app/db/drizzle/meta/0029_snapshot.json deleted file mode 100644 index 892aaf3ba..000000000 --- a/app/db/drizzle/meta/0029_snapshot.json +++ /dev/null @@ -1,1286 +0,0 @@ -{ - "id": "825b79a1-9079-4a5e-83ea-864930b0f7b7", - "prevId": "d622d4a4-5722-4b7f-b22f-8c5184ad7148", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.device": { - "name": "device", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "website": { - "name": "website", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tags": { - "name": "tags", - "type": "text[]", - "primaryKey": false, - "notNull": false, - "default": "ARRAY[]::text[]" - }, - "link": { - "name": "link", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "use_auth": { - "name": "use_auth", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "exposure": { - "name": "exposure", - "type": "exposure", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "model": { - "name": "model", - "type": "model", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'custom'" - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "date", - "primaryKey": false, - "notNull": false - }, - "latitude": { - "name": "latitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "longitude": { - "name": "longitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_model": { - "name": "sensor_wiki_model", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.device_to_location": { - "name": "device_to_location", - "schema": "", - "columns": { - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "location_id": { - "name": "location_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "device_to_location_device_id_device_id_fk": { - "name": "device_to_location_device_id_device_id_fk", - "tableFrom": "device_to_location", - "tableTo": "device", - "columnsFrom": [ - "device_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - }, - "device_to_location_location_id_location_id_fk": { - "name": "device_to_location_location_id_location_id_fk", - "tableFrom": "device_to_location", - "tableTo": "location", - "columnsFrom": [ - "location_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "device_to_location_device_id_location_id_time_pk": { - "name": "device_to_location_device_id_location_id_time_pk", - "columns": [ - "device_id", - "location_id", - "time" - ] - } - }, - "uniqueConstraints": { - "device_to_location_device_id_location_id_time_unique": { - "name": "device_to_location_device_id_location_id_time_unique", - "nullsNotDistinct": false, - "columns": [ - "device_id", - "location_id", - "time" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.measurement": { - "name": "measurement", - "schema": "", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "location_id": { - "name": "location_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "measurement_location_id_location_id_fk": { - "name": "measurement_location_id_location_id_fk", - "tableFrom": "measurement", - "tableTo": "location", - "columnsFrom": [ - "location_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "measurement_sensor_id_time_unique": { - "name": "measurement_sensor_id_time_unique", - "nullsNotDistinct": false, - "columns": [ - "sensor_id", - "time" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.password": { - "name": "password", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "password_user_id_user_id_fk": { - "name": "password_user_id_user_id_fk", - "tableFrom": "password", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.password_reset_request": { - "name": "password_reset_request", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "password_reset_request_user_id_user_id_fk": { - "name": "password_reset_request_user_id_user_id_fk", - "tableFrom": "password_reset_request", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "password_reset_request_user_id_unique": { - "name": "password_reset_request_user_id_unique", - "nullsNotDistinct": false, - "columns": [ - "user_id" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile": { - "name": "profile", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "username": { - "name": "username", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_user_id_user_id_fk": { - "name": "profile_user_id_user_id_fk", - "tableFrom": "profile", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "profile_username_unique": { - "name": "profile_username_unique", - "nullsNotDistinct": false, - "columns": [ - "username" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile_image": { - "name": "profile_image", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "alt_text": { - "name": "alt_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "content_type": { - "name": "content_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "blob": { - "name": "blob", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "profile_id": { - "name": "profile_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_image_profile_id_profile_id_fk": { - "name": "profile_image_profile_id_profile_id_fk", - "tableFrom": "profile_image", - "tableTo": "profile", - "columnsFrom": [ - "profile_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.sensor": { - "name": "sensor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_type": { - "name": "sensor_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_type": { - "name": "sensor_wiki_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_phenomenon": { - "name": "sensor_wiki_phenomenon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_unit": { - "name": "sensor_wiki_unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "lastMeasurement": { - "name": "lastMeasurement", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "data": { - "name": "data", - "type": "json", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "sensor_device_id_device_id_fk": { - "name": "sensor_device_id_device_id_fk", - "tableFrom": "sensor", - "tableTo": "device", - "columnsFrom": [ - "device_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "unconfirmed_email": { - "name": "unconfirmed_email", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'user'" - }, - "language": { - "name": "language", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'en_US'" - }, - "email_is_confirmed": { - "name": "email_is_confirmed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "email_confirmation_token": { - "name": "email_confirmation_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "user_email_unique": { - "name": "user_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - }, - "user_unconfirmed_email_unique": { - "name": "user_unconfirmed_email_unique", - "nullsNotDistinct": false, - "columns": [ - "unconfirmed_email" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.location": { - "name": "location", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "location": { - "name": "location", - "type": "geometry(point)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "location_index": { - "name": "location_index", - "columns": [ - { - "expression": "location", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "location_location_unique": { - "name": "location_location_unique", - "nullsNotDistinct": false, - "columns": [ - "location" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.log_entry": { - "name": "log_entry", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.refresh_token": { - "name": "refresh_token", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "refresh_token_user_id_user_id_fk": { - "name": "refresh_token_user_id_user_id_fk", - "tableFrom": "refresh_token", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.token_revocation": { - "name": "token_revocation", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "json", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.claim": { - "name": "claim", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "box_id": { - "name": "box_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "claim_expires_at_idx": { - "name": "claim_expires_at_idx", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "claim_box_id_device_id_fk": { - "name": "claim_box_id_device_id_fk", - "tableFrom": "claim", - "tableTo": "device", - "columnsFrom": [ - "box_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "unique_box_id": { - "name": "unique_box_id", - "nullsNotDistinct": false, - "columns": [ - "box_id" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.device_api_key": { - "name": "device_api_key", - "schema": "", - "columns": { - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "api_key": { - "name": "api_key", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "device_api_key_device_id_device_id_fk": { - "name": "device_api_key_device_id_device_id_fk", - "tableFrom": "device_api_key", - "tableTo": "device", - "columnsFrom": [ - "device_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "public.exposure": { - "name": "exposure", - "schema": "public", - "values": [ - "indoor", - "outdoor", - "mobile", - "unknown" - ] - }, - "public.model": { - "name": "model", - "schema": "public", - "values": [ - "homeV2Lora", - "homeV2Ethernet", - "homeV2Wifi", - "homeEthernet", - "homeWifi", - "homeEthernetFeinstaub", - "homeWifiFeinstaub", - "luftdaten_sds011", - "luftdaten_sds011_dht11", - "luftdaten_sds011_dht22", - "luftdaten_sds011_bmp180", - "luftdaten_sds011_bme280", - "hackair_home_v2", - "senseBox:Edu", - "luftdaten.info", - "custom" - ] - }, - "public.status": { - "name": "status", - "schema": "public", - "values": [ - "active", - "inactive", - "old" - ] - } - }, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": { - "public.measurement_10min": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_10min", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1day": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1day", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1hour": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1hour", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1month": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1month", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1year": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1year", - "schema": "public", - "isExisting": true, - "materialized": true - } - }, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/app/db/drizzle/meta/0030_snapshot.json b/app/db/drizzle/meta/0030_snapshot.json deleted file mode 100644 index 322681764..000000000 --- a/app/db/drizzle/meta/0030_snapshot.json +++ /dev/null @@ -1,1253 +0,0 @@ -{ - "id": "962a5afc-671c-43ef-b967-5571d0fc3776", - "prevId": "825b79a1-9079-4a5e-83ea-864930b0f7b7", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.device": { - "name": "device", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "website": { - "name": "website", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tags": { - "name": "tags", - "type": "text[]", - "primaryKey": false, - "notNull": false, - "default": "ARRAY[]::text[]" - }, - "link": { - "name": "link", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "use_auth": { - "name": "use_auth", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "apiKey": { - "name": "apiKey", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "exposure": { - "name": "exposure", - "type": "exposure", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "model": { - "name": "model", - "type": "model", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'custom'" - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "date", - "primaryKey": false, - "notNull": false - }, - "latitude": { - "name": "latitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "longitude": { - "name": "longitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_model": { - "name": "sensor_wiki_model", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.device_to_location": { - "name": "device_to_location", - "schema": "", - "columns": { - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "location_id": { - "name": "location_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "device_to_location_device_id_device_id_fk": { - "name": "device_to_location_device_id_device_id_fk", - "tableFrom": "device_to_location", - "tableTo": "device", - "columnsFrom": [ - "device_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - }, - "device_to_location_location_id_location_id_fk": { - "name": "device_to_location_location_id_location_id_fk", - "tableFrom": "device_to_location", - "tableTo": "location", - "columnsFrom": [ - "location_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "device_to_location_device_id_location_id_time_pk": { - "name": "device_to_location_device_id_location_id_time_pk", - "columns": [ - "device_id", - "location_id", - "time" - ] - } - }, - "uniqueConstraints": { - "device_to_location_device_id_location_id_time_unique": { - "name": "device_to_location_device_id_location_id_time_unique", - "nullsNotDistinct": false, - "columns": [ - "device_id", - "location_id", - "time" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.measurement": { - "name": "measurement", - "schema": "", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "location_id": { - "name": "location_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "measurement_location_id_location_id_fk": { - "name": "measurement_location_id_location_id_fk", - "tableFrom": "measurement", - "tableTo": "location", - "columnsFrom": [ - "location_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "measurement_sensor_id_time_unique": { - "name": "measurement_sensor_id_time_unique", - "nullsNotDistinct": false, - "columns": [ - "sensor_id", - "time" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.password": { - "name": "password", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "password_user_id_user_id_fk": { - "name": "password_user_id_user_id_fk", - "tableFrom": "password", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.password_reset_request": { - "name": "password_reset_request", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "password_reset_request_user_id_user_id_fk": { - "name": "password_reset_request_user_id_user_id_fk", - "tableFrom": "password_reset_request", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "password_reset_request_user_id_unique": { - "name": "password_reset_request_user_id_unique", - "nullsNotDistinct": false, - "columns": [ - "user_id" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile": { - "name": "profile", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "username": { - "name": "username", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_user_id_user_id_fk": { - "name": "profile_user_id_user_id_fk", - "tableFrom": "profile", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "profile_username_unique": { - "name": "profile_username_unique", - "nullsNotDistinct": false, - "columns": [ - "username" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile_image": { - "name": "profile_image", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "alt_text": { - "name": "alt_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "content_type": { - "name": "content_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "blob": { - "name": "blob", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "profile_id": { - "name": "profile_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_image_profile_id_profile_id_fk": { - "name": "profile_image_profile_id_profile_id_fk", - "tableFrom": "profile_image", - "tableTo": "profile", - "columnsFrom": [ - "profile_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.sensor": { - "name": "sensor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_type": { - "name": "sensor_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_type": { - "name": "sensor_wiki_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_phenomenon": { - "name": "sensor_wiki_phenomenon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_unit": { - "name": "sensor_wiki_unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "lastMeasurement": { - "name": "lastMeasurement", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "data": { - "name": "data", - "type": "json", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "sensor_device_id_device_id_fk": { - "name": "sensor_device_id_device_id_fk", - "tableFrom": "sensor", - "tableTo": "device", - "columnsFrom": [ - "device_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "unconfirmed_email": { - "name": "unconfirmed_email", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'user'" - }, - "language": { - "name": "language", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'en_US'" - }, - "email_is_confirmed": { - "name": "email_is_confirmed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "email_confirmation_token": { - "name": "email_confirmation_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "user_email_unique": { - "name": "user_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - }, - "user_unconfirmed_email_unique": { - "name": "user_unconfirmed_email_unique", - "nullsNotDistinct": false, - "columns": [ - "unconfirmed_email" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.location": { - "name": "location", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "location": { - "name": "location", - "type": "geometry(point)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "location_index": { - "name": "location_index", - "columns": [ - { - "expression": "location", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "location_location_unique": { - "name": "location_location_unique", - "nullsNotDistinct": false, - "columns": [ - "location" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.log_entry": { - "name": "log_entry", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.refresh_token": { - "name": "refresh_token", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "refresh_token_user_id_user_id_fk": { - "name": "refresh_token_user_id_user_id_fk", - "tableFrom": "refresh_token", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.token_revocation": { - "name": "token_revocation", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "json", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.claim": { - "name": "claim", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "box_id": { - "name": "box_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "claim_expires_at_idx": { - "name": "claim_expires_at_idx", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "claim_box_id_device_id_fk": { - "name": "claim_box_id_device_id_fk", - "tableFrom": "claim", - "tableTo": "device", - "columnsFrom": [ - "box_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "unique_box_id": { - "name": "unique_box_id", - "nullsNotDistinct": false, - "columns": [ - "box_id" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "public.exposure": { - "name": "exposure", - "schema": "public", - "values": [ - "indoor", - "outdoor", - "mobile", - "unknown" - ] - }, - "public.model": { - "name": "model", - "schema": "public", - "values": [ - "homeV2Lora", - "homeV2Ethernet", - "homeV2Wifi", - "homeEthernet", - "homeWifi", - "homeEthernetFeinstaub", - "homeWifiFeinstaub", - "luftdaten_sds011", - "luftdaten_sds011_dht11", - "luftdaten_sds011_dht22", - "luftdaten_sds011_bmp180", - "luftdaten_sds011_bme280", - "hackair_home_v2", - "senseBox:Edu", - "luftdaten.info", - "custom" - ] - }, - "public.status": { - "name": "status", - "schema": "public", - "values": [ - "active", - "inactive", - "old" - ] - } - }, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": { - "public.measurement_10min": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_10min", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1day": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1day", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1hour": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1hour", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1month": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1month", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1year": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1year", - "schema": "public", - "isExisting": true, - "materialized": true - } - }, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/app/db/drizzle/meta/0031_snapshot.json b/app/db/drizzle/meta/0031_snapshot.json deleted file mode 100644 index 623a8cc39..000000000 --- a/app/db/drizzle/meta/0031_snapshot.json +++ /dev/null @@ -1,1330 +0,0 @@ -{ - "id": "09759b9c-faa8-4f1f-ac8f-7ea3e78edcb4", - "prevId": "962a5afc-671c-43ef-b967-5571d0fc3776", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.device": { - "name": "device", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "website": { - "name": "website", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tags": { - "name": "tags", - "type": "text[]", - "primaryKey": false, - "notNull": false, - "default": "ARRAY[]::text[]" - }, - "link": { - "name": "link", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "use_auth": { - "name": "use_auth", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "apiKey": { - "name": "apiKey", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "exposure": { - "name": "exposure", - "type": "exposure", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "model": { - "name": "model", - "type": "model", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'custom'" - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "date", - "primaryKey": false, - "notNull": false - }, - "latitude": { - "name": "latitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "longitude": { - "name": "longitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_model": { - "name": "sensor_wiki_model", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.device_to_location": { - "name": "device_to_location", - "schema": "", - "columns": { - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "location_id": { - "name": "location_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "device_to_location_device_id_device_id_fk": { - "name": "device_to_location_device_id_device_id_fk", - "tableFrom": "device_to_location", - "tableTo": "device", - "columnsFrom": [ - "device_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - }, - "device_to_location_location_id_location_id_fk": { - "name": "device_to_location_location_id_location_id_fk", - "tableFrom": "device_to_location", - "tableTo": "location", - "columnsFrom": [ - "location_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "device_to_location_device_id_location_id_time_pk": { - "name": "device_to_location_device_id_location_id_time_pk", - "columns": [ - "device_id", - "location_id", - "time" - ] - } - }, - "uniqueConstraints": { - "device_to_location_device_id_location_id_time_unique": { - "name": "device_to_location_device_id_location_id_time_unique", - "nullsNotDistinct": false, - "columns": [ - "device_id", - "location_id", - "time" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.measurement": { - "name": "measurement", - "schema": "", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "location_id": { - "name": "location_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "measurement_location_id_location_id_fk": { - "name": "measurement_location_id_location_id_fk", - "tableFrom": "measurement", - "tableTo": "location", - "columnsFrom": [ - "location_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "measurement_sensor_id_time_unique": { - "name": "measurement_sensor_id_time_unique", - "nullsNotDistinct": false, - "columns": [ - "sensor_id", - "time" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.password": { - "name": "password", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "password_user_id_user_id_fk": { - "name": "password_user_id_user_id_fk", - "tableFrom": "password", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.password_reset_request": { - "name": "password_reset_request", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "password_reset_request_user_id_user_id_fk": { - "name": "password_reset_request_user_id_user_id_fk", - "tableFrom": "password_reset_request", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "password_reset_request_user_id_unique": { - "name": "password_reset_request_user_id_unique", - "nullsNotDistinct": false, - "columns": [ - "user_id" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile": { - "name": "profile", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "username": { - "name": "username", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_user_id_user_id_fk": { - "name": "profile_user_id_user_id_fk", - "tableFrom": "profile", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "profile_username_unique": { - "name": "profile_username_unique", - "nullsNotDistinct": false, - "columns": [ - "username" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile_image": { - "name": "profile_image", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "alt_text": { - "name": "alt_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "content_type": { - "name": "content_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "blob": { - "name": "blob", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "profile_id": { - "name": "profile_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_image_profile_id_profile_id_fk": { - "name": "profile_image_profile_id_profile_id_fk", - "tableFrom": "profile_image", - "tableTo": "profile", - "columnsFrom": [ - "profile_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.sensor": { - "name": "sensor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_type": { - "name": "sensor_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_type": { - "name": "sensor_wiki_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_phenomenon": { - "name": "sensor_wiki_phenomenon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_unit": { - "name": "sensor_wiki_unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "lastMeasurement": { - "name": "lastMeasurement", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "data": { - "name": "data", - "type": "json", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "sensor_device_id_device_id_fk": { - "name": "sensor_device_id_device_id_fk", - "tableFrom": "sensor", - "tableTo": "device", - "columnsFrom": [ - "device_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "unconfirmed_email": { - "name": "unconfirmed_email", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'user'" - }, - "language": { - "name": "language", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'en_US'" - }, - "email_is_confirmed": { - "name": "email_is_confirmed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "email_confirmation_token": { - "name": "email_confirmation_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "user_email_unique": { - "name": "user_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - }, - "user_unconfirmed_email_unique": { - "name": "user_unconfirmed_email_unique", - "nullsNotDistinct": false, - "columns": [ - "unconfirmed_email" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.location": { - "name": "location", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "location": { - "name": "location", - "type": "geometry(point)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "location_index": { - "name": "location_index", - "columns": [ - { - "expression": "location", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "location_location_unique": { - "name": "location_location_unique", - "nullsNotDistinct": false, - "columns": [ - "location" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.log_entry": { - "name": "log_entry", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.refresh_token": { - "name": "refresh_token", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "refresh_token_user_id_user_id_fk": { - "name": "refresh_token_user_id_user_id_fk", - "tableFrom": "refresh_token", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.token_revocation": { - "name": "token_revocation", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "json", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.claim": { - "name": "claim", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "box_id": { - "name": "box_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "claim_expires_at_idx": { - "name": "claim_expires_at_idx", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "claim_box_id_device_id_fk": { - "name": "claim_box_id_device_id_fk", - "tableFrom": "claim", - "tableTo": "device", - "columnsFrom": [ - "box_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "unique_box_id": { - "name": "unique_box_id", - "nullsNotDistinct": false, - "columns": [ - "box_id" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.integration": { - "name": "integration", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "slug": { - "name": "slug", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "service_url": { - "name": "service_url", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "service_key": { - "name": "service_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "order": { - "name": "order", - "type": "integer", - "primaryKey": false, - "notNull": false, - "default": 0 - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "integration_slug_unique": { - "name": "integration_slug_unique", - "nullsNotDistinct": false, - "columns": [ - "slug" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "public.exposure": { - "name": "exposure", - "schema": "public", - "values": [ - "indoor", - "outdoor", - "mobile", - "unknown" - ] - }, - "public.model": { - "name": "model", - "schema": "public", - "values": [ - "homeV2Lora", - "homeV2Ethernet", - "homeV2Wifi", - "homeEthernet", - "homeWifi", - "homeEthernetFeinstaub", - "homeWifiFeinstaub", - "luftdaten_sds011", - "luftdaten_sds011_dht11", - "luftdaten_sds011_dht22", - "luftdaten_sds011_bmp180", - "luftdaten_sds011_bme280", - "hackair_home_v2", - "senseBox:Edu", - "luftdaten.info", - "custom" - ] - }, - "public.status": { - "name": "status", - "schema": "public", - "values": [ - "active", - "inactive", - "old" - ] - } - }, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": { - "public.measurement_10min": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_10min", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1day": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1day", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1hour": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1hour", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1month": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1month", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1year": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1year", - "schema": "public", - "isExisting": true, - "materialized": true - } - }, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/app/db/drizzle/meta/0032_snapshot.json b/app/db/drizzle/meta/0032_snapshot.json deleted file mode 100644 index 0caec2f25..000000000 --- a/app/db/drizzle/meta/0032_snapshot.json +++ /dev/null @@ -1,1330 +0,0 @@ -{ - "id": "d10e9d1c-dc82-4f0a-b93c-8810a746fe55", - "prevId": "09759b9c-faa8-4f1f-ac8f-7ea3e78edcb4", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.device": { - "name": "device", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "website": { - "name": "website", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tags": { - "name": "tags", - "type": "text[]", - "primaryKey": false, - "notNull": false, - "default": "ARRAY[]::text[]" - }, - "link": { - "name": "link", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "use_auth": { - "name": "use_auth", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "apiKey": { - "name": "apiKey", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "exposure": { - "name": "exposure", - "type": "exposure", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "model": { - "name": "model", - "type": "model", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'custom'" - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "date", - "primaryKey": false, - "notNull": false - }, - "latitude": { - "name": "latitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "longitude": { - "name": "longitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_model": { - "name": "sensor_wiki_model", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.device_to_location": { - "name": "device_to_location", - "schema": "", - "columns": { - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "location_id": { - "name": "location_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "device_to_location_device_id_device_id_fk": { - "name": "device_to_location_device_id_device_id_fk", - "tableFrom": "device_to_location", - "tableTo": "device", - "columnsFrom": [ - "device_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - }, - "device_to_location_location_id_location_id_fk": { - "name": "device_to_location_location_id_location_id_fk", - "tableFrom": "device_to_location", - "tableTo": "location", - "columnsFrom": [ - "location_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "device_to_location_device_id_location_id_time_pk": { - "name": "device_to_location_device_id_location_id_time_pk", - "columns": [ - "device_id", - "location_id", - "time" - ] - } - }, - "uniqueConstraints": { - "device_to_location_device_id_location_id_time_unique": { - "name": "device_to_location_device_id_location_id_time_unique", - "nullsNotDistinct": false, - "columns": [ - "device_id", - "location_id", - "time" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.measurement": { - "name": "measurement", - "schema": "", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "location_id": { - "name": "location_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "measurement_location_id_location_id_fk": { - "name": "measurement_location_id_location_id_fk", - "tableFrom": "measurement", - "tableTo": "location", - "columnsFrom": [ - "location_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "measurement_sensor_id_time_unique": { - "name": "measurement_sensor_id_time_unique", - "nullsNotDistinct": false, - "columns": [ - "sensor_id", - "time" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.password": { - "name": "password", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "password_user_id_user_id_fk": { - "name": "password_user_id_user_id_fk", - "tableFrom": "password", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.password_reset_request": { - "name": "password_reset_request", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "password_reset_request_user_id_user_id_fk": { - "name": "password_reset_request_user_id_user_id_fk", - "tableFrom": "password_reset_request", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "password_reset_request_user_id_unique": { - "name": "password_reset_request_user_id_unique", - "nullsNotDistinct": false, - "columns": [ - "user_id" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile": { - "name": "profile", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "username": { - "name": "username", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_user_id_user_id_fk": { - "name": "profile_user_id_user_id_fk", - "tableFrom": "profile", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "profile_username_unique": { - "name": "profile_username_unique", - "nullsNotDistinct": false, - "columns": [ - "username" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile_image": { - "name": "profile_image", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "alt_text": { - "name": "alt_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "content_type": { - "name": "content_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "blob": { - "name": "blob", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "profile_id": { - "name": "profile_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_image_profile_id_profile_id_fk": { - "name": "profile_image_profile_id_profile_id_fk", - "tableFrom": "profile_image", - "tableTo": "profile", - "columnsFrom": [ - "profile_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.sensor": { - "name": "sensor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_type": { - "name": "sensor_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_type": { - "name": "sensor_wiki_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_phenomenon": { - "name": "sensor_wiki_phenomenon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_unit": { - "name": "sensor_wiki_unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "lastMeasurement": { - "name": "lastMeasurement", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "data": { - "name": "data", - "type": "json", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "sensor_device_id_device_id_fk": { - "name": "sensor_device_id_device_id_fk", - "tableFrom": "sensor", - "tableTo": "device", - "columnsFrom": [ - "device_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "unconfirmed_email": { - "name": "unconfirmed_email", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'user'" - }, - "language": { - "name": "language", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'en_US'" - }, - "email_is_confirmed": { - "name": "email_is_confirmed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "email_confirmation_token": { - "name": "email_confirmation_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "user_email_unique": { - "name": "user_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - }, - "user_unconfirmed_email_unique": { - "name": "user_unconfirmed_email_unique", - "nullsNotDistinct": false, - "columns": [ - "unconfirmed_email" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.location": { - "name": "location", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "location": { - "name": "location", - "type": "geometry(point)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "location_index": { - "name": "location_index", - "columns": [ - { - "expression": "location", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "location_location_unique": { - "name": "location_location_unique", - "nullsNotDistinct": false, - "columns": [ - "location" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.log_entry": { - "name": "log_entry", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.refresh_token": { - "name": "refresh_token", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "refresh_token_user_id_user_id_fk": { - "name": "refresh_token_user_id_user_id_fk", - "tableFrom": "refresh_token", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.token_revocation": { - "name": "token_revocation", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "json", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.claim": { - "name": "claim", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "box_id": { - "name": "box_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "claim_expires_at_idx": { - "name": "claim_expires_at_idx", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "claim_box_id_device_id_fk": { - "name": "claim_box_id_device_id_fk", - "tableFrom": "claim", - "tableTo": "device", - "columnsFrom": [ - "box_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "unique_box_id": { - "name": "unique_box_id", - "nullsNotDistinct": false, - "columns": [ - "box_id" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.integration": { - "name": "integration", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "slug": { - "name": "slug", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "service_url": { - "name": "service_url", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "service_key": { - "name": "service_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "order": { - "name": "order", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "integration_slug_unique": { - "name": "integration_slug_unique", - "nullsNotDistinct": false, - "columns": [ - "slug" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "public.exposure": { - "name": "exposure", - "schema": "public", - "values": [ - "indoor", - "outdoor", - "mobile", - "unknown" - ] - }, - "public.model": { - "name": "model", - "schema": "public", - "values": [ - "homeV2Lora", - "homeV2Ethernet", - "homeV2Wifi", - "homeEthernet", - "homeWifi", - "homeEthernetFeinstaub", - "homeWifiFeinstaub", - "luftdaten_sds011", - "luftdaten_sds011_dht11", - "luftdaten_sds011_dht22", - "luftdaten_sds011_bmp180", - "luftdaten_sds011_bme280", - "hackair_home_v2", - "senseBox:Edu", - "luftdaten.info", - "custom" - ] - }, - "public.status": { - "name": "status", - "schema": "public", - "values": [ - "active", - "inactive", - "old" - ] - } - }, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": { - "public.measurement_10min": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_10min", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1day": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1day", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1hour": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1hour", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1month": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1month", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1year": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1year", - "schema": "public", - "isExisting": true, - "materialized": true - } - }, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/app/db/drizzle/meta/0033_snapshot.json b/app/db/drizzle/meta/0033_snapshot.json deleted file mode 100644 index 5fc862663..000000000 --- a/app/db/drizzle/meta/0033_snapshot.json +++ /dev/null @@ -1,1330 +0,0 @@ -{ - "id": "2b328f08-9cdd-4a4f-a611-cd519981dd08", - "prevId": "d10e9d1c-dc82-4f0a-b93c-8810a746fe55", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.device": { - "name": "device", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "website": { - "name": "website", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tags": { - "name": "tags", - "type": "text[]", - "primaryKey": false, - "notNull": false, - "default": "ARRAY[]::text[]" - }, - "link": { - "name": "link", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "use_auth": { - "name": "use_auth", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "apiKey": { - "name": "apiKey", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "exposure": { - "name": "exposure", - "type": "exposure", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "model": { - "name": "model", - "type": "model", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'custom'" - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "expires_at": { - "name": "expires_at", - "type": "date", - "primaryKey": false, - "notNull": false - }, - "latitude": { - "name": "latitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "longitude": { - "name": "longitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_model": { - "name": "sensor_wiki_model", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.device_to_location": { - "name": "device_to_location", - "schema": "", - "columns": { - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "location_id": { - "name": "location_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "device_to_location_device_id_device_id_fk": { - "name": "device_to_location_device_id_device_id_fk", - "tableFrom": "device_to_location", - "tableTo": "device", - "columnsFrom": [ - "device_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - }, - "device_to_location_location_id_location_id_fk": { - "name": "device_to_location_location_id_location_id_fk", - "tableFrom": "device_to_location", - "tableTo": "location", - "columnsFrom": [ - "location_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "device_to_location_device_id_location_id_time_pk": { - "name": "device_to_location_device_id_location_id_time_pk", - "columns": [ - "device_id", - "location_id", - "time" - ] - } - }, - "uniqueConstraints": { - "device_to_location_device_id_location_id_time_unique": { - "name": "device_to_location_device_id_location_id_time_unique", - "nullsNotDistinct": false, - "columns": [ - "device_id", - "location_id", - "time" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.measurement": { - "name": "measurement", - "schema": "", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "location_id": { - "name": "location_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "measurement_location_id_location_id_fk": { - "name": "measurement_location_id_location_id_fk", - "tableFrom": "measurement", - "tableTo": "location", - "columnsFrom": [ - "location_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "measurement_sensor_id_time_unique": { - "name": "measurement_sensor_id_time_unique", - "nullsNotDistinct": false, - "columns": [ - "sensor_id", - "time" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.password": { - "name": "password", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "password_user_id_user_id_fk": { - "name": "password_user_id_user_id_fk", - "tableFrom": "password", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.password_reset_request": { - "name": "password_reset_request", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "password_reset_request_user_id_user_id_fk": { - "name": "password_reset_request_user_id_user_id_fk", - "tableFrom": "password_reset_request", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "password_reset_request_user_id_unique": { - "name": "password_reset_request_user_id_unique", - "nullsNotDistinct": false, - "columns": [ - "user_id" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile": { - "name": "profile", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "username": { - "name": "username", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_user_id_user_id_fk": { - "name": "profile_user_id_user_id_fk", - "tableFrom": "profile", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "profile_username_unique": { - "name": "profile_username_unique", - "nullsNotDistinct": false, - "columns": [ - "username" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile_image": { - "name": "profile_image", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "alt_text": { - "name": "alt_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "content_type": { - "name": "content_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "blob": { - "name": "blob", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "profile_id": { - "name": "profile_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_image_profile_id_profile_id_fk": { - "name": "profile_image_profile_id_profile_id_fk", - "tableFrom": "profile_image", - "tableTo": "profile", - "columnsFrom": [ - "profile_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.sensor": { - "name": "sensor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_type": { - "name": "sensor_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_type": { - "name": "sensor_wiki_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_phenomenon": { - "name": "sensor_wiki_phenomenon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_unit": { - "name": "sensor_wiki_unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "lastMeasurement": { - "name": "lastMeasurement", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "data": { - "name": "data", - "type": "json", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "sensor_device_id_device_id_fk": { - "name": "sensor_device_id_device_id_fk", - "tableFrom": "sensor", - "tableTo": "device", - "columnsFrom": [ - "device_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "unconfirmed_email": { - "name": "unconfirmed_email", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'user'" - }, - "language": { - "name": "language", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'en_US'" - }, - "email_is_confirmed": { - "name": "email_is_confirmed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "email_confirmation_token": { - "name": "email_confirmation_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "user_email_unique": { - "name": "user_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - }, - "user_unconfirmed_email_unique": { - "name": "user_unconfirmed_email_unique", - "nullsNotDistinct": false, - "columns": [ - "unconfirmed_email" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.location": { - "name": "location", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "location": { - "name": "location", - "type": "geometry(point)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "location_index": { - "name": "location_index", - "columns": [ - { - "expression": "location", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "location_location_unique": { - "name": "location_location_unique", - "nullsNotDistinct": false, - "columns": [ - "location" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.log_entry": { - "name": "log_entry", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.refresh_token": { - "name": "refresh_token", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "refresh_token_user_id_user_id_fk": { - "name": "refresh_token_user_id_user_id_fk", - "tableFrom": "refresh_token", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.token_revocation": { - "name": "token_revocation", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "json", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.claim": { - "name": "claim", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "box_id": { - "name": "box_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "claim_expires_at_idx": { - "name": "claim_expires_at_idx", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "claim_box_id_device_id_fk": { - "name": "claim_box_id_device_id_fk", - "tableFrom": "claim", - "tableTo": "device", - "columnsFrom": [ - "box_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "unique_box_id": { - "name": "unique_box_id", - "nullsNotDistinct": false, - "columns": [ - "box_id" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.integration": { - "name": "integration", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "slug": { - "name": "slug", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "service_url": { - "name": "service_url", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "service_key": { - "name": "service_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "order": { - "name": "order", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "integration_slug_unique": { - "name": "integration_slug_unique", - "nullsNotDistinct": false, - "columns": [ - "slug" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "public.exposure": { - "name": "exposure", - "schema": "public", - "values": [ - "indoor", - "outdoor", - "mobile", - "unknown" - ] - }, - "public.model": { - "name": "model", - "schema": "public", - "values": [ - "homeV2Lora", - "homeV2Ethernet", - "homeV2Wifi", - "homeEthernet", - "homeWifi", - "homeEthernetFeinstaub", - "homeWifiFeinstaub", - "luftdaten_sds011", - "luftdaten_sds011_dht11", - "luftdaten_sds011_dht22", - "luftdaten_sds011_bmp180", - "luftdaten_sds011_bme280", - "hackair_home_v2", - "senseBox:Edu", - "luftdaten.info", - "custom" - ] - }, - "public.status": { - "name": "status", - "schema": "public", - "values": [ - "active", - "inactive", - "old" - ] - } - }, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": { - "public.measurement_10min": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_10min", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1day": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1day", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1hour": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1hour", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1month": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1month", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1year": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1year", - "schema": "public", - "isExisting": true, - "materialized": true - } - }, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/app/db/drizzle/meta/0034_snapshot.json b/app/db/drizzle/meta/0034_snapshot.json deleted file mode 100644 index 0087f92f6..000000000 --- a/app/db/drizzle/meta/0034_snapshot.json +++ /dev/null @@ -1,1336 +0,0 @@ -{ - "id": "1a28ba10-b068-44e1-a093-c9b3b4374ca3", - "prevId": "2df45cfc-982c-4c7c-b2e7-6fe47039d121", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.device": { - "name": "device", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "website": { - "name": "website", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tags": { - "name": "tags", - "type": "text[]", - "primaryKey": false, - "notNull": false, - "default": "ARRAY[]::text[]" - }, - "link": { - "name": "link", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "use_auth": { - "name": "use_auth", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "apiKey": { - "name": "apiKey", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "exposure": { - "name": "exposure", - "type": "exposure", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "model": { - "name": "model", - "type": "model", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'custom'" - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "orphaned_at": { - "name": "orphaned_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "date", - "primaryKey": false, - "notNull": false - }, - "latitude": { - "name": "latitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "longitude": { - "name": "longitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_model": { - "name": "sensor_wiki_model", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.device_to_location": { - "name": "device_to_location", - "schema": "", - "columns": { - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "location_id": { - "name": "location_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "device_to_location_device_id_device_id_fk": { - "name": "device_to_location_device_id_device_id_fk", - "tableFrom": "device_to_location", - "tableTo": "device", - "columnsFrom": [ - "device_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - }, - "device_to_location_location_id_location_id_fk": { - "name": "device_to_location_location_id_location_id_fk", - "tableFrom": "device_to_location", - "tableTo": "location", - "columnsFrom": [ - "location_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "device_to_location_device_id_location_id_time_pk": { - "name": "device_to_location_device_id_location_id_time_pk", - "columns": [ - "device_id", - "location_id", - "time" - ] - } - }, - "uniqueConstraints": { - "device_to_location_device_id_location_id_time_unique": { - "name": "device_to_location_device_id_location_id_time_unique", - "nullsNotDistinct": false, - "columns": [ - "device_id", - "location_id", - "time" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.measurement": { - "name": "measurement", - "schema": "", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "location_id": { - "name": "location_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "measurement_location_id_location_id_fk": { - "name": "measurement_location_id_location_id_fk", - "tableFrom": "measurement", - "tableTo": "location", - "columnsFrom": [ - "location_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "measurement_sensor_id_time_unique": { - "name": "measurement_sensor_id_time_unique", - "nullsNotDistinct": false, - "columns": [ - "sensor_id", - "time" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.password": { - "name": "password", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "password_user_id_user_id_fk": { - "name": "password_user_id_user_id_fk", - "tableFrom": "password", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.password_reset_request": { - "name": "password_reset_request", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "password_reset_request_user_id_user_id_fk": { - "name": "password_reset_request_user_id_user_id_fk", - "tableFrom": "password_reset_request", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "password_reset_request_user_id_unique": { - "name": "password_reset_request_user_id_unique", - "nullsNotDistinct": false, - "columns": [ - "user_id" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile": { - "name": "profile", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "username": { - "name": "username", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_user_id_user_id_fk": { - "name": "profile_user_id_user_id_fk", - "tableFrom": "profile", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "profile_username_unique": { - "name": "profile_username_unique", - "nullsNotDistinct": false, - "columns": [ - "username" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile_image": { - "name": "profile_image", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "alt_text": { - "name": "alt_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "content_type": { - "name": "content_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "blob": { - "name": "blob", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "profile_id": { - "name": "profile_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_image_profile_id_profile_id_fk": { - "name": "profile_image_profile_id_profile_id_fk", - "tableFrom": "profile_image", - "tableTo": "profile", - "columnsFrom": [ - "profile_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.sensor": { - "name": "sensor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_type": { - "name": "sensor_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_type": { - "name": "sensor_wiki_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_phenomenon": { - "name": "sensor_wiki_phenomenon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_unit": { - "name": "sensor_wiki_unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "lastMeasurement": { - "name": "lastMeasurement", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "data": { - "name": "data", - "type": "json", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "sensor_device_id_device_id_fk": { - "name": "sensor_device_id_device_id_fk", - "tableFrom": "sensor", - "tableTo": "device", - "columnsFrom": [ - "device_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "unconfirmed_email": { - "name": "unconfirmed_email", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'user'" - }, - "language": { - "name": "language", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'en_US'" - }, - "email_is_confirmed": { - "name": "email_is_confirmed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "email_confirmation_token": { - "name": "email_confirmation_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "user_email_unique": { - "name": "user_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - }, - "user_unconfirmed_email_unique": { - "name": "user_unconfirmed_email_unique", - "nullsNotDistinct": false, - "columns": [ - "unconfirmed_email" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.location": { - "name": "location", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "location": { - "name": "location", - "type": "geometry(point)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "location_index": { - "name": "location_index", - "columns": [ - { - "expression": "location", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "location_location_unique": { - "name": "location_location_unique", - "nullsNotDistinct": false, - "columns": [ - "location" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.log_entry": { - "name": "log_entry", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.refresh_token": { - "name": "refresh_token", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "refresh_token_user_id_user_id_fk": { - "name": "refresh_token_user_id_user_id_fk", - "tableFrom": "refresh_token", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.token_revocation": { - "name": "token_revocation", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "json", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.claim": { - "name": "claim", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "box_id": { - "name": "box_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "claim_expires_at_idx": { - "name": "claim_expires_at_idx", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "claim_box_id_device_id_fk": { - "name": "claim_box_id_device_id_fk", - "tableFrom": "claim", - "tableTo": "device", - "columnsFrom": [ - "box_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "unique_box_id": { - "name": "unique_box_id", - "nullsNotDistinct": false, - "columns": [ - "box_id" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.integration": { - "name": "integration", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "slug": { - "name": "slug", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "service_url": { - "name": "service_url", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "service_key": { - "name": "service_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "order": { - "name": "order", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "integration_slug_unique": { - "name": "integration_slug_unique", - "nullsNotDistinct": false, - "columns": [ - "slug" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "public.exposure": { - "name": "exposure", - "schema": "public", - "values": [ - "indoor", - "outdoor", - "mobile", - "unknown" - ] - }, - "public.model": { - "name": "model", - "schema": "public", - "values": [ - "homeV2Lora", - "homeV2Ethernet", - "homeV2Wifi", - "homeEthernet", - "homeWifi", - "homeEthernetFeinstaub", - "homeWifiFeinstaub", - "luftdaten_sds011", - "luftdaten_sds011_dht11", - "luftdaten_sds011_dht22", - "luftdaten_sds011_bmp180", - "luftdaten_sds011_bme280", - "hackair_home_v2", - "senseBox:Edu", - "luftdaten.info", - "custom" - ] - }, - "public.status": { - "name": "status", - "schema": "public", - "values": [ - "active", - "inactive", - "old" - ] - } - }, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": { - "public.measurement_10min": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_10min", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1day": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1day", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1hour": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1hour", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1month": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1month", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1year": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1year", - "schema": "public", - "isExisting": true, - "materialized": true - } - }, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/app/db/drizzle/meta/0035_snapshot.json b/app/db/drizzle/meta/0035_snapshot.json deleted file mode 100644 index fb5f395fb..000000000 --- a/app/db/drizzle/meta/0035_snapshot.json +++ /dev/null @@ -1,1343 +0,0 @@ -{ - "id": "4cd6d47a-974c-4190-8e2b-29113d56eb56", - "prevId": "1a28ba10-b068-44e1-a093-c9b3b4374ca3", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.device": { - "name": "device", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "website": { - "name": "website", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tags": { - "name": "tags", - "type": "text[]", - "primaryKey": false, - "notNull": false, - "default": "ARRAY[]::text[]" - }, - "link": { - "name": "link", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "use_auth": { - "name": "use_auth", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "apiKey": { - "name": "apiKey", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "exposure": { - "name": "exposure", - "type": "exposure", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "model": { - "name": "model", - "type": "model", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'custom'" - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "orphaned_at": { - "name": "orphaned_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "date", - "primaryKey": false, - "notNull": false - }, - "latitude": { - "name": "latitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "longitude": { - "name": "longitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_model": { - "name": "sensor_wiki_model", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.device_to_location": { - "name": "device_to_location", - "schema": "", - "columns": { - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "location_id": { - "name": "location_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "device_to_location_device_id_device_id_fk": { - "name": "device_to_location_device_id_device_id_fk", - "tableFrom": "device_to_location", - "tableTo": "device", - "columnsFrom": [ - "device_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - }, - "device_to_location_location_id_location_id_fk": { - "name": "device_to_location_location_id_location_id_fk", - "tableFrom": "device_to_location", - "tableTo": "location", - "columnsFrom": [ - "location_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "device_to_location_device_id_location_id_time_pk": { - "name": "device_to_location_device_id_location_id_time_pk", - "columns": [ - "device_id", - "location_id", - "time" - ] - } - }, - "uniqueConstraints": { - "device_to_location_device_id_location_id_time_unique": { - "name": "device_to_location_device_id_location_id_time_unique", - "nullsNotDistinct": false, - "columns": [ - "device_id", - "location_id", - "time" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.measurement": { - "name": "measurement", - "schema": "", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "location_id": { - "name": "location_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "measurement_location_id_location_id_fk": { - "name": "measurement_location_id_location_id_fk", - "tableFrom": "measurement", - "tableTo": "location", - "columnsFrom": [ - "location_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "measurement_sensor_id_time_unique": { - "name": "measurement_sensor_id_time_unique", - "nullsNotDistinct": false, - "columns": [ - "sensor_id", - "time" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.password": { - "name": "password", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "password_user_id_user_id_fk": { - "name": "password_user_id_user_id_fk", - "tableFrom": "password", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.password_reset_request": { - "name": "password_reset_request", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "password_reset_request_user_id_user_id_fk": { - "name": "password_reset_request_user_id_user_id_fk", - "tableFrom": "password_reset_request", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "password_reset_request_user_id_unique": { - "name": "password_reset_request_user_id_unique", - "nullsNotDistinct": false, - "columns": [ - "user_id" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile": { - "name": "profile", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "display_name": { - "name": "display_name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "profile_user_id_user_id_fk": { - "name": "profile_user_id_user_id_fk", - "tableFrom": "profile", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "profile_user_id_unique": { - "name": "profile_user_id_unique", - "nullsNotDistinct": false, - "columns": [ - "user_id" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile_image": { - "name": "profile_image", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "alt_text": { - "name": "alt_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "content_type": { - "name": "content_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "blob": { - "name": "blob", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "profile_id": { - "name": "profile_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_image_profile_id_profile_id_fk": { - "name": "profile_image_profile_id_profile_id_fk", - "tableFrom": "profile_image", - "tableTo": "profile", - "columnsFrom": [ - "profile_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.sensor": { - "name": "sensor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_type": { - "name": "sensor_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_type": { - "name": "sensor_wiki_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_phenomenon": { - "name": "sensor_wiki_phenomenon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_unit": { - "name": "sensor_wiki_unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "lastMeasurement": { - "name": "lastMeasurement", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "data": { - "name": "data", - "type": "json", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "sensor_device_id_device_id_fk": { - "name": "sensor_device_id_device_id_fk", - "tableFrom": "sensor", - "tableTo": "device", - "columnsFrom": [ - "device_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "unconfirmed_email": { - "name": "unconfirmed_email", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'user'" - }, - "language": { - "name": "language", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'en_US'" - }, - "email_is_confirmed": { - "name": "email_is_confirmed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "email_confirmation_token": { - "name": "email_confirmation_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "user_name_unique": { - "name": "user_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - }, - "user_email_unique": { - "name": "user_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - }, - "user_unconfirmed_email_unique": { - "name": "user_unconfirmed_email_unique", - "nullsNotDistinct": false, - "columns": [ - "unconfirmed_email" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.location": { - "name": "location", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "location": { - "name": "location", - "type": "geometry(point)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "location_index": { - "name": "location_index", - "columns": [ - { - "expression": "location", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "location_location_unique": { - "name": "location_location_unique", - "nullsNotDistinct": false, - "columns": [ - "location" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.log_entry": { - "name": "log_entry", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.refresh_token": { - "name": "refresh_token", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "refresh_token_user_id_user_id_fk": { - "name": "refresh_token_user_id_user_id_fk", - "tableFrom": "refresh_token", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.token_revocation": { - "name": "token_revocation", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "json", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.claim": { - "name": "claim", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "box_id": { - "name": "box_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "claim_expires_at_idx": { - "name": "claim_expires_at_idx", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "claim_box_id_device_id_fk": { - "name": "claim_box_id_device_id_fk", - "tableFrom": "claim", - "tableTo": "device", - "columnsFrom": [ - "box_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "unique_box_id": { - "name": "unique_box_id", - "nullsNotDistinct": false, - "columns": [ - "box_id" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.integration": { - "name": "integration", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "slug": { - "name": "slug", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "service_url": { - "name": "service_url", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "service_key": { - "name": "service_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "order": { - "name": "order", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "integration_slug_unique": { - "name": "integration_slug_unique", - "nullsNotDistinct": false, - "columns": [ - "slug" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "public.exposure": { - "name": "exposure", - "schema": "public", - "values": [ - "indoor", - "outdoor", - "mobile", - "unknown" - ] - }, - "public.model": { - "name": "model", - "schema": "public", - "values": [ - "homeV2Lora", - "homeV2Ethernet", - "homeV2Wifi", - "homeEthernet", - "homeWifi", - "homeEthernetFeinstaub", - "homeWifiFeinstaub", - "luftdaten_sds011", - "luftdaten_sds011_dht11", - "luftdaten_sds011_dht22", - "luftdaten_sds011_bmp180", - "luftdaten_sds011_bme280", - "hackair_home_v2", - "senseBox:Edu", - "luftdaten.info", - "custom" - ] - }, - "public.status": { - "name": "status", - "schema": "public", - "values": [ - "active", - "inactive", - "old" - ] - } - }, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": { - "public.measurement_10min": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_10min", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1day": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1day", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1hour": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1hour", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1month": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1month", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1year": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1year", - "schema": "public", - "isExisting": true, - "materialized": true - } - }, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/app/db/drizzle/meta/0036_snapshot.json b/app/db/drizzle/meta/0036_snapshot.json deleted file mode 100644 index 076e089f4..000000000 --- a/app/db/drizzle/meta/0036_snapshot.json +++ /dev/null @@ -1,1350 +0,0 @@ -{ - "id": "cf6968f1-c554-4f95-a276-0c25511c7421", - "prevId": "4cd6d47a-974c-4190-8e2b-29113d56eb56", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.device": { - "name": "device", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "website": { - "name": "website", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tags": { - "name": "tags", - "type": "text[]", - "primaryKey": false, - "notNull": false, - "default": "ARRAY[]::text[]" - }, - "link": { - "name": "link", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "use_auth": { - "name": "use_auth", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "apiKey": { - "name": "apiKey", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "exposure": { - "name": "exposure", - "type": "exposure", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "model": { - "name": "model", - "type": "model", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'custom'" - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "orphaned_at": { - "name": "orphaned_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "date", - "primaryKey": false, - "notNull": false - }, - "latitude": { - "name": "latitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "longitude": { - "name": "longitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_model": { - "name": "sensor_wiki_model", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.device_to_location": { - "name": "device_to_location", - "schema": "", - "columns": { - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "location_id": { - "name": "location_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "device_to_location_device_id_device_id_fk": { - "name": "device_to_location_device_id_device_id_fk", - "tableFrom": "device_to_location", - "tableTo": "device", - "columnsFrom": [ - "device_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - }, - "device_to_location_location_id_location_id_fk": { - "name": "device_to_location_location_id_location_id_fk", - "tableFrom": "device_to_location", - "tableTo": "location", - "columnsFrom": [ - "location_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "device_to_location_device_id_location_id_time_pk": { - "name": "device_to_location_device_id_location_id_time_pk", - "columns": [ - "device_id", - "location_id", - "time" - ] - } - }, - "uniqueConstraints": { - "device_to_location_device_id_location_id_time_unique": { - "name": "device_to_location_device_id_location_id_time_unique", - "nullsNotDistinct": false, - "columns": [ - "device_id", - "location_id", - "time" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.measurement": { - "name": "measurement", - "schema": "", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "location_id": { - "name": "location_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "measurement_location_id_location_id_fk": { - "name": "measurement_location_id_location_id_fk", - "tableFrom": "measurement", - "tableTo": "location", - "columnsFrom": [ - "location_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "measurement_sensor_id_time_unique": { - "name": "measurement_sensor_id_time_unique", - "nullsNotDistinct": false, - "columns": [ - "sensor_id", - "time" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.password": { - "name": "password", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "password_user_id_user_id_fk": { - "name": "password_user_id_user_id_fk", - "tableFrom": "password", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.password_reset_request": { - "name": "password_reset_request", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "password_reset_request_user_id_user_id_fk": { - "name": "password_reset_request_user_id_user_id_fk", - "tableFrom": "password_reset_request", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "password_reset_request_user_id_unique": { - "name": "password_reset_request_user_id_unique", - "nullsNotDistinct": false, - "columns": [ - "user_id" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile": { - "name": "profile", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "display_name": { - "name": "display_name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "profile_user_id_user_id_fk": { - "name": "profile_user_id_user_id_fk", - "tableFrom": "profile", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "profile_user_id_unique": { - "name": "profile_user_id_unique", - "nullsNotDistinct": false, - "columns": [ - "user_id" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile_image": { - "name": "profile_image", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "alt_text": { - "name": "alt_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "content_type": { - "name": "content_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "blob": { - "name": "blob", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "profile_id": { - "name": "profile_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_image_profile_id_profile_id_fk": { - "name": "profile_image_profile_id_profile_id_fk", - "tableFrom": "profile_image", - "tableTo": "profile", - "columnsFrom": [ - "profile_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.sensor": { - "name": "sensor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_type": { - "name": "sensor_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_type": { - "name": "sensor_wiki_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_phenomenon": { - "name": "sensor_wiki_phenomenon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_unit": { - "name": "sensor_wiki_unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "lastMeasurement": { - "name": "lastMeasurement", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "data": { - "name": "data", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "order": { - "name": "order", - "type": "integer", - "primaryKey": false, - "notNull": false, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": { - "sensor_device_id_device_id_fk": { - "name": "sensor_device_id_device_id_fk", - "tableFrom": "sensor", - "tableTo": "device", - "columnsFrom": [ - "device_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "unconfirmed_email": { - "name": "unconfirmed_email", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'user'" - }, - "language": { - "name": "language", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'en_US'" - }, - "email_is_confirmed": { - "name": "email_is_confirmed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "email_confirmation_token": { - "name": "email_confirmation_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "user_name_unique": { - "name": "user_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - }, - "user_email_unique": { - "name": "user_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - }, - "user_unconfirmed_email_unique": { - "name": "user_unconfirmed_email_unique", - "nullsNotDistinct": false, - "columns": [ - "unconfirmed_email" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.location": { - "name": "location", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "location": { - "name": "location", - "type": "geometry(point)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "location_index": { - "name": "location_index", - "columns": [ - { - "expression": "location", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "location_location_unique": { - "name": "location_location_unique", - "nullsNotDistinct": false, - "columns": [ - "location" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.log_entry": { - "name": "log_entry", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.refresh_token": { - "name": "refresh_token", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "refresh_token_user_id_user_id_fk": { - "name": "refresh_token_user_id_user_id_fk", - "tableFrom": "refresh_token", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.token_revocation": { - "name": "token_revocation", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "json", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.claim": { - "name": "claim", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "box_id": { - "name": "box_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "claim_expires_at_idx": { - "name": "claim_expires_at_idx", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "claim_box_id_device_id_fk": { - "name": "claim_box_id_device_id_fk", - "tableFrom": "claim", - "tableTo": "device", - "columnsFrom": [ - "box_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "unique_box_id": { - "name": "unique_box_id", - "nullsNotDistinct": false, - "columns": [ - "box_id" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.integration": { - "name": "integration", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "slug": { - "name": "slug", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "service_url": { - "name": "service_url", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "service_key": { - "name": "service_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "order": { - "name": "order", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "integration_slug_unique": { - "name": "integration_slug_unique", - "nullsNotDistinct": false, - "columns": [ - "slug" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "public.exposure": { - "name": "exposure", - "schema": "public", - "values": [ - "indoor", - "outdoor", - "mobile", - "unknown" - ] - }, - "public.model": { - "name": "model", - "schema": "public", - "values": [ - "homeV2Lora", - "homeV2Ethernet", - "homeV2Wifi", - "homeEthernet", - "homeWifi", - "homeEthernetFeinstaub", - "homeWifiFeinstaub", - "luftdaten_sds011", - "luftdaten_sds011_dht11", - "luftdaten_sds011_dht22", - "luftdaten_sds011_bmp180", - "luftdaten_sds011_bme280", - "hackair_home_v2", - "senseBox:Edu", - "luftdaten.info", - "custom" - ] - }, - "public.status": { - "name": "status", - "schema": "public", - "values": [ - "active", - "inactive", - "old" - ] - } - }, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": { - "public.measurement_10min": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_10min", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1day": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1day", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1hour": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1hour", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1month": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1month", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1year": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1year", - "schema": "public", - "isExisting": true, - "materialized": true - } - }, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/app/db/drizzle/meta/0037_snapshot.json b/app/db/drizzle/meta/0037_snapshot.json deleted file mode 100644 index 2e27d373e..000000000 --- a/app/db/drizzle/meta/0037_snapshot.json +++ /dev/null @@ -1,1623 +0,0 @@ -{ - "id": "513e801d-dcfc-4de3-9ad9-a500787860cc", - "prevId": "cf6968f1-c554-4f95-a276-0c25511c7421", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.device": { - "name": "device", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "website": { - "name": "website", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tags": { - "name": "tags", - "type": "text[]", - "primaryKey": false, - "notNull": false, - "default": "ARRAY[]::text[]" - }, - "link": { - "name": "link", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "use_auth": { - "name": "use_auth", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "apiKey": { - "name": "apiKey", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "exposure": { - "name": "exposure", - "type": "exposure", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "model": { - "name": "model", - "type": "model", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'custom'" - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "orphaned_at": { - "name": "orphaned_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "date", - "primaryKey": false, - "notNull": false - }, - "latitude": { - "name": "latitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "longitude": { - "name": "longitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_model": { - "name": "sensor_wiki_model", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "device_user_id_user_id_fk": { - "name": "device_user_id_user_id_fk", - "tableFrom": "device", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.device_to_location": { - "name": "device_to_location", - "schema": "", - "columns": { - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "location_id": { - "name": "location_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "device_to_location_device_id_device_id_fk": { - "name": "device_to_location_device_id_device_id_fk", - "tableFrom": "device_to_location", - "tableTo": "device", - "columnsFrom": [ - "device_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - }, - "device_to_location_location_id_location_id_fk": { - "name": "device_to_location_location_id_location_id_fk", - "tableFrom": "device_to_location", - "tableTo": "location", - "columnsFrom": [ - "location_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "device_to_location_device_id_location_id_time_pk": { - "name": "device_to_location_device_id_location_id_time_pk", - "columns": [ - "device_id", - "location_id", - "time" - ] - } - }, - "uniqueConstraints": { - "device_to_location_device_id_location_id_time_unique": { - "name": "device_to_location_device_id_location_id_time_unique", - "nullsNotDistinct": false, - "columns": [ - "device_id", - "location_id", - "time" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.measurement": { - "name": "measurement", - "schema": "", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "location_id": { - "name": "location_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "measurement_location_id_location_id_fk": { - "name": "measurement_location_id_location_id_fk", - "tableFrom": "measurement", - "tableTo": "location", - "columnsFrom": [ - "location_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "measurement_sensor_id_time_unique": { - "name": "measurement_sensor_id_time_unique", - "nullsNotDistinct": false, - "columns": [ - "sensor_id", - "time" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.password": { - "name": "password", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "password_user_id_user_id_fk": { - "name": "password_user_id_user_id_fk", - "tableFrom": "password", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile": { - "name": "profile", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "display_name": { - "name": "display_name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "profile_user_id_user_id_fk": { - "name": "profile_user_id_user_id_fk", - "tableFrom": "profile", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "profile_user_id_unique": { - "name": "profile_user_id_unique", - "nullsNotDistinct": false, - "columns": [ - "user_id" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile_image": { - "name": "profile_image", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "alt_text": { - "name": "alt_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "content_type": { - "name": "content_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "blob": { - "name": "blob", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "profile_id": { - "name": "profile_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_image_profile_id_profile_id_fk": { - "name": "profile_image_profile_id_profile_id_fk", - "tableFrom": "profile_image", - "tableTo": "profile", - "columnsFrom": [ - "profile_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.sensor": { - "name": "sensor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_type": { - "name": "sensor_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_type": { - "name": "sensor_wiki_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_phenomenon": { - "name": "sensor_wiki_phenomenon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_unit": { - "name": "sensor_wiki_unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "lastMeasurement": { - "name": "lastMeasurement", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "data": { - "name": "data", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "order": { - "name": "order", - "type": "integer", - "primaryKey": false, - "notNull": false, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": { - "sensor_device_id_device_id_fk": { - "name": "sensor_device_id_device_id_fk", - "tableFrom": "sensor", - "tableTo": "device", - "columnsFrom": [ - "device_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "unconfirmed_email": { - "name": "unconfirmed_email", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'user'" - }, - "language": { - "name": "language", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'en_US'" - }, - "email_is_confirmed": { - "name": "email_is_confirmed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "accepted_tos_version_id": { - "name": "accepted_tos_version_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "accepted_tos_at": { - "name": "accepted_tos_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "user_accepted_tos_version_id_tos_version_id_fk": { - "name": "user_accepted_tos_version_id_tos_version_id_fk", - "tableFrom": "user", - "tableTo": "tos_version", - "columnsFrom": [ - "accepted_tos_version_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "user_name_unique": { - "name": "user_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - }, - "user_email_unique": { - "name": "user_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - }, - "user_unconfirmed_email_unique": { - "name": "user_unconfirmed_email_unique", - "nullsNotDistinct": false, - "columns": [ - "unconfirmed_email" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.location": { - "name": "location", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "location": { - "name": "location", - "type": "geometry(point)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "location_index": { - "name": "location_index", - "columns": [ - { - "expression": "location", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "location_location_unique": { - "name": "location_location_unique", - "nullsNotDistinct": false, - "columns": [ - "location" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.log_entry": { - "name": "log_entry", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.refresh_token": { - "name": "refresh_token", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "refresh_token_user_id_user_id_fk": { - "name": "refresh_token_user_id_user_id_fk", - "tableFrom": "refresh_token", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.token_revocation": { - "name": "token_revocation", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "json", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.claim": { - "name": "claim", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "box_id": { - "name": "box_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "claim_expires_at_idx": { - "name": "claim_expires_at_idx", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "claim_box_id_device_id_fk": { - "name": "claim_box_id_device_id_fk", - "tableFrom": "claim", - "tableTo": "device", - "columnsFrom": [ - "box_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "unique_box_id": { - "name": "unique_box_id", - "nullsNotDistinct": false, - "columns": [ - "box_id" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.integration": { - "name": "integration", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "slug": { - "name": "slug", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "service_url": { - "name": "service_url", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "service_key": { - "name": "service_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "order": { - "name": "order", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "integration_slug_unique": { - "name": "integration_slug_unique", - "nullsNotDistinct": false, - "columns": [ - "slug" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.tos_user_state": { - "name": "tos_user_state", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tos_version_id": { - "name": "tos_version_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "accepted_at": { - "name": "accepted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "tos_user_state_user_idx": { - "name": "tos_user_state_user_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "tos_user_state_user_id_user_id_fk": { - "name": "tos_user_state_user_id_user_id_fk", - "tableFrom": "tos_user_state", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "tos_user_state_tos_version_id_tos_version_id_fk": { - "name": "tos_user_state_tos_version_id_tos_version_id_fk", - "tableFrom": "tos_user_state", - "tableTo": "tos_version", - "columnsFrom": [ - "tos_version_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "tos_user_state_user_id_tos_version_id_pk": { - "name": "tos_user_state_user_id_tos_version_id_pk", - "columns": [ - "user_id", - "tos_version_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.tos_version": { - "name": "tos_version", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "version": { - "name": "version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "body": { - "name": "body", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "accept_by": { - "name": "accept_by", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "tos_version_effective_from_idx": { - "name": "tos_version_effective_from_idx", - "columns": [ - { - "expression": "effective_from", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "tos_version_accept_by_idx": { - "name": "tos_version_accept_by_idx", - "columns": [ - { - "expression": "accept_by", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "tos_version_version_unique": { - "name": "tos_version_version_unique", - "nullsNotDistinct": false, - "columns": [ - "version" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.action_token": { - "name": "action_token", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "consumed_at": { - "name": "consumed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "action_token_user_purpose_uq": { - "name": "action_token_user_purpose_uq", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "purpose", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "action_token_expires_at_idx": { - "name": "action_token_expires_at_idx", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "action_token_user_id_user_id_fk": { - "name": "action_token_user_id_user_id_fk", - "tableFrom": "action_token", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "action_token_token_hash_unique": { - "name": "action_token_token_hash_unique", - "nullsNotDistinct": false, - "columns": [ - "token_hash" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "public.exposure": { - "name": "exposure", - "schema": "public", - "values": [ - "indoor", - "outdoor", - "mobile", - "unknown" - ] - }, - "public.model": { - "name": "model", - "schema": "public", - "values": [ - "homeV2Lora", - "homeV2Ethernet", - "homeV2Wifi", - "homeEthernet", - "homeWifi", - "homeEthernetFeinstaub", - "homeWifiFeinstaub", - "luftdaten_sds011", - "luftdaten_sds011_dht11", - "luftdaten_sds011_dht22", - "luftdaten_sds011_bmp180", - "luftdaten_sds011_bme280", - "hackair_home_v2", - "senseBox:Edu", - "luftdaten.info", - "custom" - ] - }, - "public.status": { - "name": "status", - "schema": "public", - "values": [ - "active", - "inactive", - "old" - ] - } - }, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": { - "public.measurement_10min": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_10min", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1day": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1day", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1hour": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1hour", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1month": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1month", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1year": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1year", - "schema": "public", - "isExisting": true, - "materialized": true - } - }, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/app/db/drizzle/meta/0038_snapshot.json b/app/db/drizzle/meta/0038_snapshot.json deleted file mode 100644 index ee5ddb47d..000000000 --- a/app/db/drizzle/meta/0038_snapshot.json +++ /dev/null @@ -1,1617 +0,0 @@ -{ - "id": "6ecbc69b-9a3a-49e1-8ad9-980c1d92a87f", - "prevId": "513e801d-dcfc-4de3-9ad9-a500787860cc", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.device": { - "name": "device", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "website": { - "name": "website", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tags": { - "name": "tags", - "type": "text[]", - "primaryKey": false, - "notNull": false, - "default": "ARRAY[]::text[]" - }, - "link": { - "name": "link", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "use_auth": { - "name": "use_auth", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "apiKey": { - "name": "apiKey", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "exposure": { - "name": "exposure", - "type": "exposure", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "model": { - "name": "model", - "type": "model", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'custom'" - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "orphaned_at": { - "name": "orphaned_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "date", - "primaryKey": false, - "notNull": false - }, - "latitude": { - "name": "latitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "longitude": { - "name": "longitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_model": { - "name": "sensor_wiki_model", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "device_user_id_user_id_fk": { - "name": "device_user_id_user_id_fk", - "tableFrom": "device", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.device_to_location": { - "name": "device_to_location", - "schema": "", - "columns": { - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "location_id": { - "name": "location_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "device_to_location_device_id_device_id_fk": { - "name": "device_to_location_device_id_device_id_fk", - "tableFrom": "device_to_location", - "tableTo": "device", - "columnsFrom": [ - "device_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - }, - "device_to_location_location_id_location_id_fk": { - "name": "device_to_location_location_id_location_id_fk", - "tableFrom": "device_to_location", - "tableTo": "location", - "columnsFrom": [ - "location_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "device_to_location_device_id_location_id_time_pk": { - "name": "device_to_location_device_id_location_id_time_pk", - "columns": [ - "device_id", - "location_id", - "time" - ] - } - }, - "uniqueConstraints": { - "device_to_location_device_id_location_id_time_unique": { - "name": "device_to_location_device_id_location_id_time_unique", - "nullsNotDistinct": false, - "columns": [ - "device_id", - "location_id", - "time" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.measurement": { - "name": "measurement", - "schema": "", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "location_id": { - "name": "location_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "measurement_location_id_location_id_fk": { - "name": "measurement_location_id_location_id_fk", - "tableFrom": "measurement", - "tableTo": "location", - "columnsFrom": [ - "location_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "measurement_sensor_id_time_unique": { - "name": "measurement_sensor_id_time_unique", - "nullsNotDistinct": false, - "columns": [ - "sensor_id", - "time" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.password": { - "name": "password", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "password_user_id_user_id_fk": { - "name": "password_user_id_user_id_fk", - "tableFrom": "password", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile": { - "name": "profile", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "display_name": { - "name": "display_name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "profile_user_id_user_id_fk": { - "name": "profile_user_id_user_id_fk", - "tableFrom": "profile", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "profile_user_id_unique": { - "name": "profile_user_id_unique", - "nullsNotDistinct": false, - "columns": [ - "user_id" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile_image": { - "name": "profile_image", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "alt_text": { - "name": "alt_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "content_type": { - "name": "content_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "blob": { - "name": "blob", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "profile_id": { - "name": "profile_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_image_profile_id_profile_id_fk": { - "name": "profile_image_profile_id_profile_id_fk", - "tableFrom": "profile_image", - "tableTo": "profile", - "columnsFrom": [ - "profile_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.sensor": { - "name": "sensor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_type": { - "name": "sensor_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_type": { - "name": "sensor_wiki_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_phenomenon": { - "name": "sensor_wiki_phenomenon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_unit": { - "name": "sensor_wiki_unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "lastMeasurement": { - "name": "lastMeasurement", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "data": { - "name": "data", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "order": { - "name": "order", - "type": "integer", - "primaryKey": false, - "notNull": false, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": { - "sensor_device_id_device_id_fk": { - "name": "sensor_device_id_device_id_fk", - "tableFrom": "sensor", - "tableTo": "device", - "columnsFrom": [ - "device_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "unconfirmed_email": { - "name": "unconfirmed_email", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'user'" - }, - "language": { - "name": "language", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'en_US'" - }, - "email_is_confirmed": { - "name": "email_is_confirmed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "accepted_tos_version_id": { - "name": "accepted_tos_version_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "accepted_tos_at": { - "name": "accepted_tos_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "user_accepted_tos_version_id_tos_version_id_fk": { - "name": "user_accepted_tos_version_id_tos_version_id_fk", - "tableFrom": "user", - "tableTo": "tos_version", - "columnsFrom": [ - "accepted_tos_version_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "user_name_unique": { - "name": "user_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - }, - "user_email_unique": { - "name": "user_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - }, - "user_unconfirmed_email_unique": { - "name": "user_unconfirmed_email_unique", - "nullsNotDistinct": false, - "columns": [ - "unconfirmed_email" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.location": { - "name": "location", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "location": { - "name": "location", - "type": "geometry(point)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "location_index": { - "name": "location_index", - "columns": [ - { - "expression": "location", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "location_location_unique": { - "name": "location_location_unique", - "nullsNotDistinct": false, - "columns": [ - "location" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.log_entry": { - "name": "log_entry", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.refresh_token": { - "name": "refresh_token", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "refresh_token_user_id_user_id_fk": { - "name": "refresh_token_user_id_user_id_fk", - "tableFrom": "refresh_token", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.token_revocation": { - "name": "token_revocation", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "json", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.claim": { - "name": "claim", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "box_id": { - "name": "box_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "claim_expires_at_idx": { - "name": "claim_expires_at_idx", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "claim_box_id_device_id_fk": { - "name": "claim_box_id_device_id_fk", - "tableFrom": "claim", - "tableTo": "device", - "columnsFrom": [ - "box_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "unique_box_id": { - "name": "unique_box_id", - "nullsNotDistinct": false, - "columns": [ - "box_id" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.integration": { - "name": "integration", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "slug": { - "name": "slug", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "service_url": { - "name": "service_url", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "service_key": { - "name": "service_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "order": { - "name": "order", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "integration_slug_unique": { - "name": "integration_slug_unique", - "nullsNotDistinct": false, - "columns": [ - "slug" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.tos_user_state": { - "name": "tos_user_state", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tos_version_id": { - "name": "tos_version_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "accepted_at": { - "name": "accepted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "tos_user_state_user_idx": { - "name": "tos_user_state_user_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "tos_user_state_user_id_user_id_fk": { - "name": "tos_user_state_user_id_user_id_fk", - "tableFrom": "tos_user_state", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "tos_user_state_tos_version_id_tos_version_id_fk": { - "name": "tos_user_state_tos_version_id_tos_version_id_fk", - "tableFrom": "tos_user_state", - "tableTo": "tos_version", - "columnsFrom": [ - "tos_version_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "tos_user_state_user_id_tos_version_id_pk": { - "name": "tos_user_state_user_id_tos_version_id_pk", - "columns": [ - "user_id", - "tos_version_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.tos_version": { - "name": "tos_version", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "version": { - "name": "version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "body": { - "name": "body", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "accept_by": { - "name": "accept_by", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "tos_version_effective_from_idx": { - "name": "tos_version_effective_from_idx", - "columns": [ - { - "expression": "effective_from", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "tos_version_accept_by_idx": { - "name": "tos_version_accept_by_idx", - "columns": [ - { - "expression": "accept_by", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "tos_version_version_unique": { - "name": "tos_version_version_unique", - "nullsNotDistinct": false, - "columns": [ - "version" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.action_token": { - "name": "action_token", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "action_token_user_purpose_uq": { - "name": "action_token_user_purpose_uq", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "purpose", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "action_token_expires_at_idx": { - "name": "action_token_expires_at_idx", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "action_token_user_id_user_id_fk": { - "name": "action_token_user_id_user_id_fk", - "tableFrom": "action_token", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "action_token_token_hash_unique": { - "name": "action_token_token_hash_unique", - "nullsNotDistinct": false, - "columns": [ - "token_hash" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "public.exposure": { - "name": "exposure", - "schema": "public", - "values": [ - "indoor", - "outdoor", - "mobile", - "unknown" - ] - }, - "public.model": { - "name": "model", - "schema": "public", - "values": [ - "homeV2Lora", - "homeV2Ethernet", - "homeV2Wifi", - "homeEthernet", - "homeWifi", - "homeEthernetFeinstaub", - "homeWifiFeinstaub", - "luftdaten_sds011", - "luftdaten_sds011_dht11", - "luftdaten_sds011_dht22", - "luftdaten_sds011_bmp180", - "luftdaten_sds011_bme280", - "hackair_home_v2", - "senseBox:Edu", - "luftdaten.info", - "custom" - ] - }, - "public.status": { - "name": "status", - "schema": "public", - "values": [ - "active", - "inactive", - "old" - ] - } - }, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": { - "public.measurement_10min": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_10min", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1day": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1day", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1hour": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1hour", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1month": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1month", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1year": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1year", - "schema": "public", - "isExisting": true, - "materialized": true - } - }, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/app/db/drizzle/meta/0039_snapshot.json b/app/db/drizzle/meta/0039_snapshot.json deleted file mode 100644 index 0887e5780..000000000 --- a/app/db/drizzle/meta/0039_snapshot.json +++ /dev/null @@ -1,1617 +0,0 @@ -{ - "id": "b685080d-7e89-48b2-8e06-0f413d73f935", - "prevId": "6ecbc69b-9a3a-49e1-8ad9-980c1d92a87f", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.device": { - "name": "device", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "website": { - "name": "website", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tags": { - "name": "tags", - "type": "text[]", - "primaryKey": false, - "notNull": false, - "default": "ARRAY[]::text[]" - }, - "link": { - "name": "link", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "use_auth": { - "name": "use_auth", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "apiKey": { - "name": "apiKey", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "exposure": { - "name": "exposure", - "type": "exposure", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "model": { - "name": "model", - "type": "model", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'custom'" - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "orphaned_at": { - "name": "orphaned_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "date", - "primaryKey": false, - "notNull": false - }, - "latitude": { - "name": "latitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "longitude": { - "name": "longitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_model": { - "name": "sensor_wiki_model", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "device_user_id_user_id_fk": { - "name": "device_user_id_user_id_fk", - "tableFrom": "device", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.device_to_location": { - "name": "device_to_location", - "schema": "", - "columns": { - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "location_id": { - "name": "location_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "device_to_location_device_id_device_id_fk": { - "name": "device_to_location_device_id_device_id_fk", - "tableFrom": "device_to_location", - "columnsFrom": [ - "device_id" - ], - "tableTo": "device", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "cascade" - }, - "device_to_location_location_id_location_id_fk": { - "name": "device_to_location_location_id_location_id_fk", - "tableFrom": "device_to_location", - "columnsFrom": [ - "location_id" - ], - "tableTo": "location", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": { - "device_to_location_device_id_location_id_time_pk": { - "name": "device_to_location_device_id_location_id_time_pk", - "columns": [ - "device_id", - "location_id", - "time" - ] - } - }, - "uniqueConstraints": { - "device_to_location_device_id_location_id_time_unique": { - "name": "device_to_location_device_id_location_id_time_unique", - "columns": [ - "device_id", - "location_id", - "time" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.measurement": { - "name": "measurement", - "schema": "", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "location_id": { - "name": "location_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "measurement_location_id_location_id_fk": { - "name": "measurement_location_id_location_id_fk", - "tableFrom": "measurement", - "columnsFrom": [ - "location_id" - ], - "tableTo": "location", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "measurement_sensor_id_time_unique": { - "name": "measurement_sensor_id_time_unique", - "columns": [ - "sensor_id", - "time" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.password": { - "name": "password", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "password_user_id_user_id_fk": { - "name": "password_user_id_user_id_fk", - "tableFrom": "password", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile": { - "name": "profile", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "display_name": { - "name": "display_name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "profile_user_id_user_id_fk": { - "name": "profile_user_id_user_id_fk", - "tableFrom": "profile", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "profile_user_id_unique": { - "name": "profile_user_id_unique", - "columns": [ - "user_id" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile_image": { - "name": "profile_image", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "alt_text": { - "name": "alt_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "content_type": { - "name": "content_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "blob": { - "name": "blob", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "profile_id": { - "name": "profile_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_image_profile_id_profile_id_fk": { - "name": "profile_image_profile_id_profile_id_fk", - "tableFrom": "profile_image", - "columnsFrom": [ - "profile_id" - ], - "tableTo": "profile", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.sensor": { - "name": "sensor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_type": { - "name": "sensor_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_type": { - "name": "sensor_wiki_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_phenomenon": { - "name": "sensor_wiki_phenomenon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_unit": { - "name": "sensor_wiki_unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "lastMeasurement": { - "name": "lastMeasurement", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "data": { - "name": "data", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "order": { - "name": "order", - "type": "integer", - "primaryKey": false, - "notNull": false, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": { - "sensor_device_id_device_id_fk": { - "name": "sensor_device_id_device_id_fk", - "tableFrom": "sensor", - "columnsFrom": [ - "device_id" - ], - "tableTo": "device", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "unconfirmed_email": { - "name": "unconfirmed_email", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'user'" - }, - "language": { - "name": "language", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'en_US'" - }, - "email_is_confirmed": { - "name": "email_is_confirmed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "accepted_tos_version_id": { - "name": "accepted_tos_version_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "accepted_tos_at": { - "name": "accepted_tos_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "user_accepted_tos_version_id_tos_version_id_fk": { - "name": "user_accepted_tos_version_id_tos_version_id_fk", - "tableFrom": "user", - "columnsFrom": [ - "accepted_tos_version_id" - ], - "tableTo": "tos_version", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "user_name_unique": { - "name": "user_name_unique", - "columns": [ - "name" - ], - "nullsNotDistinct": false - }, - "user_email_unique": { - "name": "user_email_unique", - "columns": [ - "email" - ], - "nullsNotDistinct": false - }, - "user_unconfirmed_email_unique": { - "name": "user_unconfirmed_email_unique", - "columns": [ - "unconfirmed_email" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.location": { - "name": "location", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "location": { - "name": "location", - "type": "geometry(point)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "location_index": { - "name": "location_index", - "columns": [ - { - "expression": "location", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "location_location_unique": { - "name": "location_location_unique", - "columns": [ - "location" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.log_entry": { - "name": "log_entry", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.refresh_token": { - "name": "refresh_token", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "refresh_token_user_id_user_id_fk": { - "name": "refresh_token_user_id_user_id_fk", - "tableFrom": "refresh_token", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.token_revocation": { - "name": "token_revocation", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "json", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.claim": { - "name": "claim", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "box_id": { - "name": "box_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "claim_expires_at_idx": { - "name": "claim_expires_at_idx", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "claim_box_id_device_id_fk": { - "name": "claim_box_id_device_id_fk", - "tableFrom": "claim", - "columnsFrom": [ - "box_id" - ], - "tableTo": "device", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "unique_box_id": { - "name": "unique_box_id", - "columns": [ - "box_id" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.integration": { - "name": "integration", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "slug": { - "name": "slug", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "service_url": { - "name": "service_url", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "service_key": { - "name": "service_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "order": { - "name": "order", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "integration_slug_unique": { - "name": "integration_slug_unique", - "columns": [ - "slug" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.tos_user_state": { - "name": "tos_user_state", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tos_version_id": { - "name": "tos_version_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "accepted_at": { - "name": "accepted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "tos_user_state_user_idx": { - "name": "tos_user_state_user_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "tos_user_state_user_id_user_id_fk": { - "name": "tos_user_state_user_id_user_id_fk", - "tableFrom": "tos_user_state", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "tos_user_state_tos_version_id_tos_version_id_fk": { - "name": "tos_user_state_tos_version_id_tos_version_id_fk", - "tableFrom": "tos_user_state", - "columnsFrom": [ - "tos_version_id" - ], - "tableTo": "tos_version", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "tos_user_state_user_id_tos_version_id_pk": { - "name": "tos_user_state_user_id_tos_version_id_pk", - "columns": [ - "user_id", - "tos_version_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.tos_version": { - "name": "tos_version", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "version": { - "name": "version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "body": { - "name": "body", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "accept_by": { - "name": "accept_by", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "tos_version_effective_from_idx": { - "name": "tos_version_effective_from_idx", - "columns": [ - { - "expression": "effective_from", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "tos_version_accept_by_idx": { - "name": "tos_version_accept_by_idx", - "columns": [ - { - "expression": "accept_by", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "tos_version_version_unique": { - "name": "tos_version_version_unique", - "columns": [ - "version" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.action_token": { - "name": "action_token", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "action_token_user_purpose_uq": { - "name": "action_token_user_purpose_uq", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "purpose", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "concurrently": false - }, - "action_token_expires_at_idx": { - "name": "action_token_expires_at_idx", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "action_token_user_id_user_id_fk": { - "name": "action_token_user_id_user_id_fk", - "tableFrom": "action_token", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "action_token_token_hash_unique": { - "name": "action_token_token_hash_unique", - "columns": [ - "token_hash" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "public.exposure": { - "name": "exposure", - "schema": "public", - "values": [ - "indoor", - "outdoor", - "mobile", - "unknown" - ] - }, - "public.model": { - "name": "model", - "schema": "public", - "values": [ - "homeV2Lora", - "homeV2Ethernet", - "homeV2Wifi", - "homeEthernet", - "homeWifi", - "homeEthernetFeinstaub", - "homeWifiFeinstaub", - "luftdaten_sds011", - "luftdaten_sds011_dht11", - "luftdaten_sds011_dht22", - "luftdaten_sds011_bmp180", - "luftdaten_sds011_bme280", - "hackair_home_v2", - "senseBox:Edu", - "luftdaten.info", - "custom" - ] - }, - "public.status": { - "name": "status", - "schema": "public", - "values": [ - "active", - "inactive", - "old" - ] - } - }, - "schemas": {}, - "views": { - "public.measurement_10min": { - "name": "measurement_10min", - "schema": "public", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "materialized": true, - "isExisting": true - }, - "public.measurement_1day": { - "name": "measurement_1day", - "schema": "public", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "materialized": true, - "isExisting": true - }, - "public.measurement_1hour": { - "name": "measurement_1hour", - "schema": "public", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "materialized": true, - "isExisting": true - }, - "public.measurement_1month": { - "name": "measurement_1month", - "schema": "public", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "materialized": true, - "isExisting": true - }, - "public.measurement_1year": { - "name": "measurement_1year", - "schema": "public", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "materialized": true, - "isExisting": true - } - }, - "sequences": {}, - "roles": {}, - "policies": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/app/db/drizzle/meta/0040_snapshot.json b/app/db/drizzle/meta/0040_snapshot.json deleted file mode 100644 index c00eae8a3..000000000 --- a/app/db/drizzle/meta/0040_snapshot.json +++ /dev/null @@ -1,1623 +0,0 @@ -{ - "id": "1a430a1e-6dd4-473a-9e4a-8872c158f420", - "prevId": "b685080d-7e89-48b2-8e06-0f413d73f935", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.device": { - "name": "device", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "website": { - "name": "website", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tags": { - "name": "tags", - "type": "text[]", - "primaryKey": false, - "notNull": false, - "default": "ARRAY[]::text[]" - }, - "link": { - "name": "link", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "use_auth": { - "name": "use_auth", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "apiKey": { - "name": "apiKey", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "exposure": { - "name": "exposure", - "type": "exposure", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "model": { - "name": "model", - "type": "model", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'custom'" - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "archived_at": { - "name": "archived_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "orphaned_at": { - "name": "orphaned_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "date", - "primaryKey": false, - "notNull": false - }, - "latitude": { - "name": "latitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "longitude": { - "name": "longitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_model": { - "name": "sensor_wiki_model", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "device_user_id_user_id_fk": { - "name": "device_user_id_user_id_fk", - "tableFrom": "device", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.device_to_location": { - "name": "device_to_location", - "schema": "", - "columns": { - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "location_id": { - "name": "location_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "device_to_location_device_id_device_id_fk": { - "name": "device_to_location_device_id_device_id_fk", - "tableFrom": "device_to_location", - "tableTo": "device", - "columnsFrom": [ - "device_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - }, - "device_to_location_location_id_location_id_fk": { - "name": "device_to_location_location_id_location_id_fk", - "tableFrom": "device_to_location", - "tableTo": "location", - "columnsFrom": [ - "location_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "device_to_location_device_id_location_id_time_pk": { - "name": "device_to_location_device_id_location_id_time_pk", - "columns": [ - "device_id", - "location_id", - "time" - ] - } - }, - "uniqueConstraints": { - "device_to_location_device_id_location_id_time_unique": { - "name": "device_to_location_device_id_location_id_time_unique", - "nullsNotDistinct": false, - "columns": [ - "device_id", - "location_id", - "time" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.measurement": { - "name": "measurement", - "schema": "", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "location_id": { - "name": "location_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "measurement_location_id_location_id_fk": { - "name": "measurement_location_id_location_id_fk", - "tableFrom": "measurement", - "tableTo": "location", - "columnsFrom": [ - "location_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "measurement_sensor_id_time_unique": { - "name": "measurement_sensor_id_time_unique", - "nullsNotDistinct": false, - "columns": [ - "sensor_id", - "time" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.password": { - "name": "password", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "password_user_id_user_id_fk": { - "name": "password_user_id_user_id_fk", - "tableFrom": "password", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile": { - "name": "profile", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "display_name": { - "name": "display_name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "profile_user_id_user_id_fk": { - "name": "profile_user_id_user_id_fk", - "tableFrom": "profile", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "profile_user_id_unique": { - "name": "profile_user_id_unique", - "nullsNotDistinct": false, - "columns": [ - "user_id" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile_image": { - "name": "profile_image", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "alt_text": { - "name": "alt_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "content_type": { - "name": "content_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "blob": { - "name": "blob", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "profile_id": { - "name": "profile_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_image_profile_id_profile_id_fk": { - "name": "profile_image_profile_id_profile_id_fk", - "tableFrom": "profile_image", - "tableTo": "profile", - "columnsFrom": [ - "profile_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.sensor": { - "name": "sensor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_type": { - "name": "sensor_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_type": { - "name": "sensor_wiki_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_phenomenon": { - "name": "sensor_wiki_phenomenon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_unit": { - "name": "sensor_wiki_unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "lastMeasurement": { - "name": "lastMeasurement", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "data": { - "name": "data", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "order": { - "name": "order", - "type": "integer", - "primaryKey": false, - "notNull": false, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": { - "sensor_device_id_device_id_fk": { - "name": "sensor_device_id_device_id_fk", - "tableFrom": "sensor", - "tableTo": "device", - "columnsFrom": [ - "device_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "unconfirmed_email": { - "name": "unconfirmed_email", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'user'" - }, - "language": { - "name": "language", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'en_US'" - }, - "email_is_confirmed": { - "name": "email_is_confirmed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "accepted_tos_version_id": { - "name": "accepted_tos_version_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "accepted_tos_at": { - "name": "accepted_tos_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "user_accepted_tos_version_id_tos_version_id_fk": { - "name": "user_accepted_tos_version_id_tos_version_id_fk", - "tableFrom": "user", - "tableTo": "tos_version", - "columnsFrom": [ - "accepted_tos_version_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "user_name_unique": { - "name": "user_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - }, - "user_email_unique": { - "name": "user_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - }, - "user_unconfirmed_email_unique": { - "name": "user_unconfirmed_email_unique", - "nullsNotDistinct": false, - "columns": [ - "unconfirmed_email" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.location": { - "name": "location", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "location": { - "name": "location", - "type": "geometry(point)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "location_index": { - "name": "location_index", - "columns": [ - { - "expression": "location", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "location_location_unique": { - "name": "location_location_unique", - "nullsNotDistinct": false, - "columns": [ - "location" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.log_entry": { - "name": "log_entry", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.refresh_token": { - "name": "refresh_token", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "refresh_token_user_id_user_id_fk": { - "name": "refresh_token_user_id_user_id_fk", - "tableFrom": "refresh_token", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.token_revocation": { - "name": "token_revocation", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "json", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.claim": { - "name": "claim", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "box_id": { - "name": "box_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "claim_expires_at_idx": { - "name": "claim_expires_at_idx", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "claim_box_id_device_id_fk": { - "name": "claim_box_id_device_id_fk", - "tableFrom": "claim", - "tableTo": "device", - "columnsFrom": [ - "box_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "unique_box_id": { - "name": "unique_box_id", - "nullsNotDistinct": false, - "columns": [ - "box_id" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.integration": { - "name": "integration", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "slug": { - "name": "slug", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "service_url": { - "name": "service_url", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "service_key": { - "name": "service_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "order": { - "name": "order", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "integration_slug_unique": { - "name": "integration_slug_unique", - "nullsNotDistinct": false, - "columns": [ - "slug" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.tos_user_state": { - "name": "tos_user_state", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tos_version_id": { - "name": "tos_version_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "accepted_at": { - "name": "accepted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "tos_user_state_user_idx": { - "name": "tos_user_state_user_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "tos_user_state_user_id_user_id_fk": { - "name": "tos_user_state_user_id_user_id_fk", - "tableFrom": "tos_user_state", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "tos_user_state_tos_version_id_tos_version_id_fk": { - "name": "tos_user_state_tos_version_id_tos_version_id_fk", - "tableFrom": "tos_user_state", - "tableTo": "tos_version", - "columnsFrom": [ - "tos_version_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "tos_user_state_user_id_tos_version_id_pk": { - "name": "tos_user_state_user_id_tos_version_id_pk", - "columns": [ - "user_id", - "tos_version_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.tos_version": { - "name": "tos_version", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "version": { - "name": "version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "body": { - "name": "body", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "accept_by": { - "name": "accept_by", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "tos_version_effective_from_idx": { - "name": "tos_version_effective_from_idx", - "columns": [ - { - "expression": "effective_from", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "tos_version_accept_by_idx": { - "name": "tos_version_accept_by_idx", - "columns": [ - { - "expression": "accept_by", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "tos_version_version_unique": { - "name": "tos_version_version_unique", - "nullsNotDistinct": false, - "columns": [ - "version" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.action_token": { - "name": "action_token", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "action_token_user_purpose_uq": { - "name": "action_token_user_purpose_uq", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "purpose", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "action_token_expires_at_idx": { - "name": "action_token_expires_at_idx", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "action_token_user_id_user_id_fk": { - "name": "action_token_user_id_user_id_fk", - "tableFrom": "action_token", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "action_token_token_hash_unique": { - "name": "action_token_token_hash_unique", - "nullsNotDistinct": false, - "columns": [ - "token_hash" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "public.exposure": { - "name": "exposure", - "schema": "public", - "values": [ - "indoor", - "outdoor", - "mobile", - "unknown" - ] - }, - "public.model": { - "name": "model", - "schema": "public", - "values": [ - "homeV2Lora", - "homeV2Ethernet", - "homeV2Wifi", - "homeEthernet", - "homeWifi", - "homeEthernetFeinstaub", - "homeWifiFeinstaub", - "luftdaten_sds011", - "luftdaten_sds011_dht11", - "luftdaten_sds011_dht22", - "luftdaten_sds011_bmp180", - "luftdaten_sds011_bme280", - "hackair_home_v2", - "senseBox:Edu", - "luftdaten.info", - "custom" - ] - }, - "public.status": { - "name": "status", - "schema": "public", - "values": [ - "active", - "inactive", - "old" - ] - } - }, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": { - "public.measurement_10min": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_10min", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1day": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1day", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1hour": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1hour", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1month": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1month", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1year": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1year", - "schema": "public", - "isExisting": true, - "materialized": true - } - }, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/app/db/drizzle/meta/0041_snapshot.json b/app/db/drizzle/meta/0041_snapshot.json deleted file mode 100644 index 121f55807..000000000 --- a/app/db/drizzle/meta/0041_snapshot.json +++ /dev/null @@ -1,1623 +0,0 @@ -{ - "id": "aff47dec-8f78-438d-adb7-ff7b2c7e676b", - "prevId": "1a430a1e-6dd4-473a-9e4a-8872c158f420", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.device": { - "name": "device", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "website": { - "name": "website", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tags": { - "name": "tags", - "type": "text[]", - "primaryKey": false, - "notNull": false, - "default": "ARRAY[]::text[]" - }, - "link": { - "name": "link", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "use_auth": { - "name": "use_auth", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "apiKey": { - "name": "apiKey", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "exposure": { - "name": "exposure", - "type": "exposure", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "model": { - "name": "model", - "type": "model", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'custom'" - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "archived_at": { - "name": "archived_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "orphaned_at": { - "name": "orphaned_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "date", - "primaryKey": false, - "notNull": false - }, - "latitude": { - "name": "latitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "longitude": { - "name": "longitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_model": { - "name": "sensor_wiki_model", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "device_user_id_user_id_fk": { - "name": "device_user_id_user_id_fk", - "tableFrom": "device", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.device_to_location": { - "name": "device_to_location", - "schema": "", - "columns": { - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "location_id": { - "name": "location_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "device_to_location_device_id_device_id_fk": { - "name": "device_to_location_device_id_device_id_fk", - "tableFrom": "device_to_location", - "columnsFrom": [ - "device_id" - ], - "tableTo": "device", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "cascade" - }, - "device_to_location_location_id_location_id_fk": { - "name": "device_to_location_location_id_location_id_fk", - "tableFrom": "device_to_location", - "columnsFrom": [ - "location_id" - ], - "tableTo": "location", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": { - "device_to_location_device_id_location_id_time_pk": { - "name": "device_to_location_device_id_location_id_time_pk", - "columns": [ - "device_id", - "location_id", - "time" - ] - } - }, - "uniqueConstraints": { - "device_to_location_device_id_location_id_time_unique": { - "name": "device_to_location_device_id_location_id_time_unique", - "columns": [ - "device_id", - "location_id", - "time" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.measurement": { - "name": "measurement", - "schema": "", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "location_id": { - "name": "location_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "measurement_location_id_location_id_fk": { - "name": "measurement_location_id_location_id_fk", - "tableFrom": "measurement", - "columnsFrom": [ - "location_id" - ], - "tableTo": "location", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "measurement_sensor_id_time_unique": { - "name": "measurement_sensor_id_time_unique", - "columns": [ - "sensor_id", - "time" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.password": { - "name": "password", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "password_user_id_user_id_fk": { - "name": "password_user_id_user_id_fk", - "tableFrom": "password", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile": { - "name": "profile", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "display_name": { - "name": "display_name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "profile_user_id_user_id_fk": { - "name": "profile_user_id_user_id_fk", - "tableFrom": "profile", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "profile_user_id_unique": { - "name": "profile_user_id_unique", - "columns": [ - "user_id" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile_image": { - "name": "profile_image", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "alt_text": { - "name": "alt_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "content_type": { - "name": "content_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "blob": { - "name": "blob", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "profile_id": { - "name": "profile_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_image_profile_id_profile_id_fk": { - "name": "profile_image_profile_id_profile_id_fk", - "tableFrom": "profile_image", - "columnsFrom": [ - "profile_id" - ], - "tableTo": "profile", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.sensor": { - "name": "sensor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_type": { - "name": "sensor_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_type": { - "name": "sensor_wiki_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_phenomenon": { - "name": "sensor_wiki_phenomenon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_unit": { - "name": "sensor_wiki_unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "lastMeasurement": { - "name": "lastMeasurement", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "data": { - "name": "data", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "order": { - "name": "order", - "type": "integer", - "primaryKey": false, - "notNull": false, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": { - "sensor_device_id_device_id_fk": { - "name": "sensor_device_id_device_id_fk", - "tableFrom": "sensor", - "columnsFrom": [ - "device_id" - ], - "tableTo": "device", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "unconfirmed_email": { - "name": "unconfirmed_email", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'user'" - }, - "language": { - "name": "language", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'en_US'" - }, - "email_is_confirmed": { - "name": "email_is_confirmed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "accepted_tos_version_id": { - "name": "accepted_tos_version_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "accepted_tos_at": { - "name": "accepted_tos_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "user_accepted_tos_version_id_tos_version_id_fk": { - "name": "user_accepted_tos_version_id_tos_version_id_fk", - "tableFrom": "user", - "columnsFrom": [ - "accepted_tos_version_id" - ], - "tableTo": "tos_version", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "user_name_unique": { - "name": "user_name_unique", - "columns": [ - "name" - ], - "nullsNotDistinct": false - }, - "user_email_unique": { - "name": "user_email_unique", - "columns": [ - "email" - ], - "nullsNotDistinct": false - }, - "user_unconfirmed_email_unique": { - "name": "user_unconfirmed_email_unique", - "columns": [ - "unconfirmed_email" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.location": { - "name": "location", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "location": { - "name": "location", - "type": "geometry(point)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "location_index": { - "name": "location_index", - "columns": [ - { - "expression": "location", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "gist", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "location_location_unique": { - "name": "location_location_unique", - "columns": [ - "location" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.log_entry": { - "name": "log_entry", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.refresh_token": { - "name": "refresh_token", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "refresh_token_user_id_user_id_fk": { - "name": "refresh_token_user_id_user_id_fk", - "tableFrom": "refresh_token", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.token_revocation": { - "name": "token_revocation", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "json", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.claim": { - "name": "claim", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "box_id": { - "name": "box_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "claim_expires_at_idx": { - "name": "claim_expires_at_idx", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "claim_box_id_device_id_fk": { - "name": "claim_box_id_device_id_fk", - "tableFrom": "claim", - "columnsFrom": [ - "box_id" - ], - "tableTo": "device", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "unique_box_id": { - "name": "unique_box_id", - "columns": [ - "box_id" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.integration": { - "name": "integration", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "slug": { - "name": "slug", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "service_url": { - "name": "service_url", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "service_key": { - "name": "service_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "order": { - "name": "order", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "integration_slug_unique": { - "name": "integration_slug_unique", - "columns": [ - "slug" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.tos_user_state": { - "name": "tos_user_state", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tos_version_id": { - "name": "tos_version_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "accepted_at": { - "name": "accepted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "tos_user_state_user_idx": { - "name": "tos_user_state_user_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "tos_user_state_user_id_user_id_fk": { - "name": "tos_user_state_user_id_user_id_fk", - "tableFrom": "tos_user_state", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "tos_user_state_tos_version_id_tos_version_id_fk": { - "name": "tos_user_state_tos_version_id_tos_version_id_fk", - "tableFrom": "tos_user_state", - "columnsFrom": [ - "tos_version_id" - ], - "tableTo": "tos_version", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "tos_user_state_user_id_tos_version_id_pk": { - "name": "tos_user_state_user_id_tos_version_id_pk", - "columns": [ - "user_id", - "tos_version_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.tos_version": { - "name": "tos_version", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "version": { - "name": "version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "body": { - "name": "body", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "accept_by": { - "name": "accept_by", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "tos_version_effective_from_idx": { - "name": "tos_version_effective_from_idx", - "columns": [ - { - "expression": "effective_from", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "tos_version_accept_by_idx": { - "name": "tos_version_accept_by_idx", - "columns": [ - { - "expression": "accept_by", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "tos_version_version_unique": { - "name": "tos_version_version_unique", - "columns": [ - "version" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.action_token": { - "name": "action_token", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "action_token_user_purpose_uq": { - "name": "action_token_user_purpose_uq", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "purpose", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "concurrently": false - }, - "action_token_expires_at_idx": { - "name": "action_token_expires_at_idx", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "action_token_user_id_user_id_fk": { - "name": "action_token_user_id_user_id_fk", - "tableFrom": "action_token", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "action_token_token_hash_unique": { - "name": "action_token_token_hash_unique", - "columns": [ - "token_hash" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "public.exposure": { - "name": "exposure", - "schema": "public", - "values": [ - "indoor", - "outdoor", - "mobile", - "unknown" - ] - }, - "public.model": { - "name": "model", - "schema": "public", - "values": [ - "homeV2Lora", - "homeV2Ethernet", - "homeV2Wifi", - "homeEthernet", - "homeWifi", - "homeEthernetFeinstaub", - "homeWifiFeinstaub", - "luftdaten_sds011", - "luftdaten_sds011_dht11", - "luftdaten_sds011_dht22", - "luftdaten_sds011_bmp180", - "luftdaten_sds011_bme280", - "hackair_home_v2", - "senseBox:Edu", - "luftdaten.info", - "custom" - ] - }, - "public.status": { - "name": "status", - "schema": "public", - "values": [ - "active", - "inactive", - "old" - ] - } - }, - "schemas": {}, - "views": { - "public.measurement_10min": { - "name": "measurement_10min", - "schema": "public", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "materialized": true, - "isExisting": true - }, - "public.measurement_1day": { - "name": "measurement_1day", - "schema": "public", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "materialized": true, - "isExisting": true - }, - "public.measurement_1hour": { - "name": "measurement_1hour", - "schema": "public", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "materialized": true, - "isExisting": true - }, - "public.measurement_1month": { - "name": "measurement_1month", - "schema": "public", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "materialized": true, - "isExisting": true - }, - "public.measurement_1year": { - "name": "measurement_1year", - "schema": "public", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "materialized": true, - "isExisting": true - } - }, - "sequences": {}, - "roles": {}, - "policies": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/app/db/drizzle/meta/0042_snapshot.json b/app/db/drizzle/meta/0042_snapshot.json deleted file mode 100644 index 7b21c5926..000000000 --- a/app/db/drizzle/meta/0042_snapshot.json +++ /dev/null @@ -1,1623 +0,0 @@ -{ - "id": "86afca58-d04e-41b3-8a69-9a4b4bfe24a4", - "prevId": "aff47dec-8f78-438d-adb7-ff7b2c7e676b", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.device": { - "name": "device", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "website": { - "name": "website", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tags": { - "name": "tags", - "type": "text[]", - "primaryKey": false, - "notNull": false, - "default": "ARRAY[]::text[]" - }, - "link": { - "name": "link", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "use_auth": { - "name": "use_auth", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "apiKey": { - "name": "apiKey", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "exposure": { - "name": "exposure", - "type": "exposure", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "model": { - "name": "model", - "type": "model", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'custom'" - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "archived_at": { - "name": "archived_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "orphaned_at": { - "name": "orphaned_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "date", - "primaryKey": false, - "notNull": false - }, - "latitude": { - "name": "latitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "longitude": { - "name": "longitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_model": { - "name": "sensor_wiki_model", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "device_user_id_user_id_fk": { - "name": "device_user_id_user_id_fk", - "tableFrom": "device", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.device_to_location": { - "name": "device_to_location", - "schema": "", - "columns": { - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "location_id": { - "name": "location_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "device_to_location_device_id_device_id_fk": { - "name": "device_to_location_device_id_device_id_fk", - "tableFrom": "device_to_location", - "tableTo": "device", - "columnsFrom": [ - "device_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - }, - "device_to_location_location_id_location_id_fk": { - "name": "device_to_location_location_id_location_id_fk", - "tableFrom": "device_to_location", - "tableTo": "location", - "columnsFrom": [ - "location_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "device_to_location_device_id_location_id_time_pk": { - "name": "device_to_location_device_id_location_id_time_pk", - "columns": [ - "device_id", - "location_id", - "time" - ] - } - }, - "uniqueConstraints": { - "device_to_location_device_id_location_id_time_unique": { - "name": "device_to_location_device_id_location_id_time_unique", - "nullsNotDistinct": false, - "columns": [ - "device_id", - "location_id", - "time" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.measurement": { - "name": "measurement", - "schema": "", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "location_id": { - "name": "location_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "measurement_location_id_location_id_fk": { - "name": "measurement_location_id_location_id_fk", - "tableFrom": "measurement", - "tableTo": "location", - "columnsFrom": [ - "location_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "measurement_sensor_id_time_unique": { - "name": "measurement_sensor_id_time_unique", - "nullsNotDistinct": false, - "columns": [ - "sensor_id", - "time" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.password": { - "name": "password", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "password_user_id_user_id_fk": { - "name": "password_user_id_user_id_fk", - "tableFrom": "password", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile": { - "name": "profile", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "display_name": { - "name": "display_name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "profile_user_id_user_id_fk": { - "name": "profile_user_id_user_id_fk", - "tableFrom": "profile", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "profile_user_id_unique": { - "name": "profile_user_id_unique", - "nullsNotDistinct": false, - "columns": [ - "user_id" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile_image": { - "name": "profile_image", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "alt_text": { - "name": "alt_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "content_type": { - "name": "content_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "blob": { - "name": "blob", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "profile_id": { - "name": "profile_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_image_profile_id_profile_id_fk": { - "name": "profile_image_profile_id_profile_id_fk", - "tableFrom": "profile_image", - "tableTo": "profile", - "columnsFrom": [ - "profile_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.sensor": { - "name": "sensor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_type": { - "name": "sensor_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_type": { - "name": "sensor_wiki_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_phenomenon": { - "name": "sensor_wiki_phenomenon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_unit": { - "name": "sensor_wiki_unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "lastMeasurement": { - "name": "lastMeasurement", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "data": { - "name": "data", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "order": { - "name": "order", - "type": "integer", - "primaryKey": false, - "notNull": false, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": { - "sensor_device_id_device_id_fk": { - "name": "sensor_device_id_device_id_fk", - "tableFrom": "sensor", - "tableTo": "device", - "columnsFrom": [ - "device_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "unconfirmed_email": { - "name": "unconfirmed_email", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'user'" - }, - "language": { - "name": "language", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'en_US'" - }, - "email_is_confirmed": { - "name": "email_is_confirmed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "accepted_tos_version_id": { - "name": "accepted_tos_version_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "accepted_tos_at": { - "name": "accepted_tos_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "user_accepted_tos_version_id_tos_version_id_fk": { - "name": "user_accepted_tos_version_id_tos_version_id_fk", - "tableFrom": "user", - "tableTo": "tos_version", - "columnsFrom": [ - "accepted_tos_version_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "user_name_unique": { - "name": "user_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - }, - "user_email_unique": { - "name": "user_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - }, - "user_unconfirmed_email_unique": { - "name": "user_unconfirmed_email_unique", - "nullsNotDistinct": false, - "columns": [ - "unconfirmed_email" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.location": { - "name": "location", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "location": { - "name": "location", - "type": "geometry(point)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "location_index": { - "name": "location_index", - "columns": [ - { - "expression": "location", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "location_location_unique": { - "name": "location_location_unique", - "nullsNotDistinct": false, - "columns": [ - "location" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.log_entry": { - "name": "log_entry", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.refresh_token": { - "name": "refresh_token", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "refresh_token_user_id_user_id_fk": { - "name": "refresh_token_user_id_user_id_fk", - "tableFrom": "refresh_token", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.token_revocation": { - "name": "token_revocation", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "json", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.claim": { - "name": "claim", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "box_id": { - "name": "box_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "claim_expires_at_idx": { - "name": "claim_expires_at_idx", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "claim_box_id_device_id_fk": { - "name": "claim_box_id_device_id_fk", - "tableFrom": "claim", - "tableTo": "device", - "columnsFrom": [ - "box_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "unique_box_id": { - "name": "unique_box_id", - "nullsNotDistinct": false, - "columns": [ - "box_id" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.integration": { - "name": "integration", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "slug": { - "name": "slug", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "service_url": { - "name": "service_url", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "service_key": { - "name": "service_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "order": { - "name": "order", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "integration_slug_unique": { - "name": "integration_slug_unique", - "nullsNotDistinct": false, - "columns": [ - "slug" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.tos_user_state": { - "name": "tos_user_state", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tos_version_id": { - "name": "tos_version_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "accepted_at": { - "name": "accepted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "tos_user_state_user_idx": { - "name": "tos_user_state_user_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "tos_user_state_user_id_user_id_fk": { - "name": "tos_user_state_user_id_user_id_fk", - "tableFrom": "tos_user_state", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "tos_user_state_tos_version_id_tos_version_id_fk": { - "name": "tos_user_state_tos_version_id_tos_version_id_fk", - "tableFrom": "tos_user_state", - "tableTo": "tos_version", - "columnsFrom": [ - "tos_version_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "tos_user_state_user_id_tos_version_id_pk": { - "name": "tos_user_state_user_id_tos_version_id_pk", - "columns": [ - "user_id", - "tos_version_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.tos_version": { - "name": "tos_version", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "version": { - "name": "version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "body": { - "name": "body", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "accept_by": { - "name": "accept_by", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "tos_version_effective_from_idx": { - "name": "tos_version_effective_from_idx", - "columns": [ - { - "expression": "effective_from", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "tos_version_accept_by_idx": { - "name": "tos_version_accept_by_idx", - "columns": [ - { - "expression": "accept_by", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "tos_version_version_unique": { - "name": "tos_version_version_unique", - "nullsNotDistinct": false, - "columns": [ - "version" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.action_token": { - "name": "action_token", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "action_token_user_purpose_uq": { - "name": "action_token_user_purpose_uq", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "purpose", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "action_token_expires_at_idx": { - "name": "action_token_expires_at_idx", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "action_token_user_id_user_id_fk": { - "name": "action_token_user_id_user_id_fk", - "tableFrom": "action_token", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "action_token_token_hash_unique": { - "name": "action_token_token_hash_unique", - "nullsNotDistinct": false, - "columns": [ - "token_hash" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "public.exposure": { - "name": "exposure", - "schema": "public", - "values": [ - "indoor", - "outdoor", - "mobile", - "unknown" - ] - }, - "public.model": { - "name": "model", - "schema": "public", - "values": [ - "homeV2Lora", - "homeV2Ethernet", - "homeV2Wifi", - "homeEthernet", - "homeWifi", - "homeEthernetFeinstaub", - "homeWifiFeinstaub", - "luftdaten_sds011", - "luftdaten_sds011_dht11", - "luftdaten_sds011_dht22", - "luftdaten_sds011_bmp180", - "luftdaten_sds011_bme280", - "hackair_home_v2", - "senseBox:Edu", - "luftdaten.info", - "custom" - ] - }, - "public.status": { - "name": "status", - "schema": "public", - "values": [ - "active", - "inactive", - "old" - ] - } - }, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": { - "public.measurement_10min": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_10min", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1day": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1day", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1hour": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1hour", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1month": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1month", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1year": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1year", - "schema": "public", - "isExisting": true, - "materialized": true - } - }, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/app/db/drizzle/meta/0043_snapshot.json b/app/db/drizzle/meta/0043_snapshot.json deleted file mode 100644 index ab478500c..000000000 --- a/app/db/drizzle/meta/0043_snapshot.json +++ /dev/null @@ -1,1640 +0,0 @@ -{ - "id": "07740930-4c95-45f7-8d50-1115b8954086", - "prevId": "86afca58-d04e-41b3-8a69-9a4b4bfe24a4", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.device": { - "name": "device", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "website": { - "name": "website", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tags": { - "name": "tags", - "type": "text[]", - "primaryKey": false, - "notNull": false, - "default": "ARRAY[]::text[]" - }, - "link": { - "name": "link", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "use_auth": { - "name": "use_auth", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "apiKey": { - "name": "apiKey", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "exposure": { - "name": "exposure", - "type": "exposure", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "model": { - "name": "model", - "type": "model", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'custom'" - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "archived_at": { - "name": "archived_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "orphaned_at": { - "name": "orphaned_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "date", - "primaryKey": false, - "notNull": false - }, - "latitude": { - "name": "latitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "longitude": { - "name": "longitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_model": { - "name": "sensor_wiki_model", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "device_user_id_user_id_fk": { - "name": "device_user_id_user_id_fk", - "tableFrom": "device", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.device_to_location": { - "name": "device_to_location", - "schema": "", - "columns": { - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "location_id": { - "name": "location_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "device_to_location_device_id_device_id_fk": { - "name": "device_to_location_device_id_device_id_fk", - "tableFrom": "device_to_location", - "tableTo": "device", - "columnsFrom": [ - "device_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - }, - "device_to_location_location_id_location_id_fk": { - "name": "device_to_location_location_id_location_id_fk", - "tableFrom": "device_to_location", - "tableTo": "location", - "columnsFrom": [ - "location_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "device_to_location_device_id_location_id_time_pk": { - "name": "device_to_location_device_id_location_id_time_pk", - "columns": [ - "device_id", - "location_id", - "time" - ] - } - }, - "uniqueConstraints": { - "device_to_location_device_id_location_id_time_unique": { - "name": "device_to_location_device_id_location_id_time_unique", - "nullsNotDistinct": false, - "columns": [ - "device_id", - "location_id", - "time" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.measurement": { - "name": "measurement", - "schema": "", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "location_id": { - "name": "location_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "measurement_location_id_location_id_fk": { - "name": "measurement_location_id_location_id_fk", - "tableFrom": "measurement", - "tableTo": "location", - "columnsFrom": [ - "location_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "measurement_sensor_id_time_unique": { - "name": "measurement_sensor_id_time_unique", - "nullsNotDistinct": false, - "columns": [ - "sensor_id", - "time" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.password": { - "name": "password", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "password_user_id_user_id_fk": { - "name": "password_user_id_user_id_fk", - "tableFrom": "password", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile": { - "name": "profile", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "display_name": { - "name": "display_name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "profile_user_id_user_id_fk": { - "name": "profile_user_id_user_id_fk", - "tableFrom": "profile", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "profile_user_id_unique": { - "name": "profile_user_id_unique", - "nullsNotDistinct": false, - "columns": [ - "user_id" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile_image": { - "name": "profile_image", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "alt_text": { - "name": "alt_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "content_type": { - "name": "content_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "blob": { - "name": "blob", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "profile_id": { - "name": "profile_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_image_profile_id_profile_id_fk": { - "name": "profile_image_profile_id_profile_id_fk", - "tableFrom": "profile_image", - "tableTo": "profile", - "columnsFrom": [ - "profile_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.sensor": { - "name": "sensor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_type": { - "name": "sensor_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_type": { - "name": "sensor_wiki_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_phenomenon": { - "name": "sensor_wiki_phenomenon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_unit": { - "name": "sensor_wiki_unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "lastMeasurement": { - "name": "lastMeasurement", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "data": { - "name": "data", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "order": { - "name": "order", - "type": "integer", - "primaryKey": false, - "notNull": false, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": { - "sensor_device_id_device_id_fk": { - "name": "sensor_device_id_device_id_fk", - "tableFrom": "sensor", - "tableTo": "device", - "columnsFrom": [ - "device_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "unconfirmed_email": { - "name": "unconfirmed_email", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "theme_preference": { - "name": "theme_preference", - "type": "theme_preference", - "typeSchema": "public", - "primaryKey": false, - "notNull": true, - "default": "'system'" - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'user'" - }, - "language": { - "name": "language", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'en_US'" - }, - "email_is_confirmed": { - "name": "email_is_confirmed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "accepted_tos_version_id": { - "name": "accepted_tos_version_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "accepted_tos_at": { - "name": "accepted_tos_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "user_accepted_tos_version_id_tos_version_id_fk": { - "name": "user_accepted_tos_version_id_tos_version_id_fk", - "tableFrom": "user", - "tableTo": "tos_version", - "columnsFrom": [ - "accepted_tos_version_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "user_name_unique": { - "name": "user_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - }, - "user_email_unique": { - "name": "user_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - }, - "user_unconfirmed_email_unique": { - "name": "user_unconfirmed_email_unique", - "nullsNotDistinct": false, - "columns": [ - "unconfirmed_email" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.location": { - "name": "location", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "location": { - "name": "location", - "type": "geometry(point)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "location_index": { - "name": "location_index", - "columns": [ - { - "expression": "location", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "location_location_unique": { - "name": "location_location_unique", - "nullsNotDistinct": false, - "columns": [ - "location" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.log_entry": { - "name": "log_entry", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.refresh_token": { - "name": "refresh_token", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "refresh_token_user_id_user_id_fk": { - "name": "refresh_token_user_id_user_id_fk", - "tableFrom": "refresh_token", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.token_revocation": { - "name": "token_revocation", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "json", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.claim": { - "name": "claim", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "box_id": { - "name": "box_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "claim_expires_at_idx": { - "name": "claim_expires_at_idx", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "claim_box_id_device_id_fk": { - "name": "claim_box_id_device_id_fk", - "tableFrom": "claim", - "tableTo": "device", - "columnsFrom": [ - "box_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "unique_box_id": { - "name": "unique_box_id", - "nullsNotDistinct": false, - "columns": [ - "box_id" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.integration": { - "name": "integration", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "slug": { - "name": "slug", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "service_url": { - "name": "service_url", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "service_key": { - "name": "service_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "order": { - "name": "order", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "integration_slug_unique": { - "name": "integration_slug_unique", - "nullsNotDistinct": false, - "columns": [ - "slug" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.tos_user_state": { - "name": "tos_user_state", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tos_version_id": { - "name": "tos_version_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "accepted_at": { - "name": "accepted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "tos_user_state_user_idx": { - "name": "tos_user_state_user_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "tos_user_state_user_id_user_id_fk": { - "name": "tos_user_state_user_id_user_id_fk", - "tableFrom": "tos_user_state", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "tos_user_state_tos_version_id_tos_version_id_fk": { - "name": "tos_user_state_tos_version_id_tos_version_id_fk", - "tableFrom": "tos_user_state", - "tableTo": "tos_version", - "columnsFrom": [ - "tos_version_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "tos_user_state_user_id_tos_version_id_pk": { - "name": "tos_user_state_user_id_tos_version_id_pk", - "columns": [ - "user_id", - "tos_version_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.tos_version": { - "name": "tos_version", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "version": { - "name": "version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "body": { - "name": "body", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "accept_by": { - "name": "accept_by", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "tos_version_effective_from_idx": { - "name": "tos_version_effective_from_idx", - "columns": [ - { - "expression": "effective_from", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "tos_version_accept_by_idx": { - "name": "tos_version_accept_by_idx", - "columns": [ - { - "expression": "accept_by", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "tos_version_version_unique": { - "name": "tos_version_version_unique", - "nullsNotDistinct": false, - "columns": [ - "version" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.action_token": { - "name": "action_token", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "action_token_user_purpose_uq": { - "name": "action_token_user_purpose_uq", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "purpose", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "action_token_expires_at_idx": { - "name": "action_token_expires_at_idx", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "action_token_user_id_user_id_fk": { - "name": "action_token_user_id_user_id_fk", - "tableFrom": "action_token", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "action_token_token_hash_unique": { - "name": "action_token_token_hash_unique", - "nullsNotDistinct": false, - "columns": [ - "token_hash" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "public.exposure": { - "name": "exposure", - "schema": "public", - "values": [ - "indoor", - "outdoor", - "mobile", - "unknown" - ] - }, - "public.model": { - "name": "model", - "schema": "public", - "values": [ - "homeV2Lora", - "homeV2Ethernet", - "homeV2Wifi", - "homeEthernet", - "homeWifi", - "homeEthernetFeinstaub", - "homeWifiFeinstaub", - "luftdaten_sds011", - "luftdaten_sds011_dht11", - "luftdaten_sds011_dht22", - "luftdaten_sds011_bmp180", - "luftdaten_sds011_bme280", - "hackair_home_v2", - "senseBox:Edu", - "luftdaten.info", - "custom" - ] - }, - "public.status": { - "name": "status", - "schema": "public", - "values": [ - "active", - "inactive", - "old" - ] - }, - "public.theme_preference": { - "name": "theme_preference", - "schema": "public", - "values": [ - "light", - "dark", - "system" - ] - } - }, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": { - "public.measurement_10min": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_10min", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1day": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1day", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1hour": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1hour", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1month": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1month", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1year": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1year", - "schema": "public", - "isExisting": true, - "materialized": true - } - }, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/app/db/drizzle/meta/0044_snapshot.json b/app/db/drizzle/meta/0044_snapshot.json deleted file mode 100644 index 8f33cb210..000000000 --- a/app/db/drizzle/meta/0044_snapshot.json +++ /dev/null @@ -1,1659 +0,0 @@ -{ - "id": "455bb6e0-7317-40b3-9d71-ef56f4443540", - "prevId": "07740930-4c95-45f7-8d50-1115b8954086", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.device": { - "name": "device", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "website": { - "name": "website", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tags": { - "name": "tags", - "type": "text[]", - "primaryKey": false, - "notNull": false, - "default": "ARRAY[]::text[]" - }, - "link": { - "name": "link", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "use_auth": { - "name": "use_auth", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "apiKey": { - "name": "apiKey", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "exposure": { - "name": "exposure", - "type": "exposure", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "model": { - "name": "model", - "type": "model", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'custom'" - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "archived_at": { - "name": "archived_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "orphaned_at": { - "name": "orphaned_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "date", - "primaryKey": false, - "notNull": false - }, - "latitude": { - "name": "latitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "longitude": { - "name": "longitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_model": { - "name": "sensor_wiki_model", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "device_user_id_user_id_fk": { - "name": "device_user_id_user_id_fk", - "tableFrom": "device", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.device_to_location": { - "name": "device_to_location", - "schema": "", - "columns": { - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "location_id": { - "name": "location_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "device_to_location_device_id_device_id_fk": { - "name": "device_to_location_device_id_device_id_fk", - "tableFrom": "device_to_location", - "tableTo": "device", - "columnsFrom": [ - "device_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - }, - "device_to_location_location_id_location_id_fk": { - "name": "device_to_location_location_id_location_id_fk", - "tableFrom": "device_to_location", - "tableTo": "location", - "columnsFrom": [ - "location_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "device_to_location_device_id_location_id_time_pk": { - "name": "device_to_location_device_id_location_id_time_pk", - "columns": [ - "device_id", - "location_id", - "time" - ] - } - }, - "uniqueConstraints": { - "device_to_location_device_id_location_id_time_unique": { - "name": "device_to_location_device_id_location_id_time_unique", - "nullsNotDistinct": false, - "columns": [ - "device_id", - "location_id", - "time" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.measurement": { - "name": "measurement", - "schema": "", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "location_id": { - "name": "location_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "measurement_location_id_location_id_fk": { - "name": "measurement_location_id_location_id_fk", - "tableFrom": "measurement", - "tableTo": "location", - "columnsFrom": [ - "location_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "measurement_sensor_id_time_unique": { - "name": "measurement_sensor_id_time_unique", - "nullsNotDistinct": false, - "columns": [ - "sensor_id", - "time" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.password": { - "name": "password", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "password_user_id_user_id_fk": { - "name": "password_user_id_user_id_fk", - "tableFrom": "password", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile": { - "name": "profile", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "display_name": { - "name": "display_name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "home_latitude": { - "name": "home_latitude", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "home_longitude": { - "name": "home_longitude", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "home_zoom": { - "name": "home_zoom", - "type": "real", - "primaryKey": false, - "notNull": false, - "default": 10 - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "profile_user_id_user_id_fk": { - "name": "profile_user_id_user_id_fk", - "tableFrom": "profile", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "profile_user_id_unique": { - "name": "profile_user_id_unique", - "nullsNotDistinct": false, - "columns": [ - "user_id" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile_image": { - "name": "profile_image", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "alt_text": { - "name": "alt_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "content_type": { - "name": "content_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "blob": { - "name": "blob", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "profile_id": { - "name": "profile_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_image_profile_id_profile_id_fk": { - "name": "profile_image_profile_id_profile_id_fk", - "tableFrom": "profile_image", - "tableTo": "profile", - "columnsFrom": [ - "profile_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.sensor": { - "name": "sensor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_type": { - "name": "sensor_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_type": { - "name": "sensor_wiki_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_phenomenon": { - "name": "sensor_wiki_phenomenon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_unit": { - "name": "sensor_wiki_unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "lastMeasurement": { - "name": "lastMeasurement", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "data": { - "name": "data", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "order": { - "name": "order", - "type": "integer", - "primaryKey": false, - "notNull": false, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": { - "sensor_device_id_device_id_fk": { - "name": "sensor_device_id_device_id_fk", - "tableFrom": "sensor", - "tableTo": "device", - "columnsFrom": [ - "device_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "unconfirmed_email": { - "name": "unconfirmed_email", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "theme_preference": { - "name": "theme_preference", - "type": "theme_preference", - "typeSchema": "public", - "primaryKey": false, - "notNull": true, - "default": "'system'" - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'user'" - }, - "language": { - "name": "language", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'en_US'" - }, - "email_is_confirmed": { - "name": "email_is_confirmed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "accepted_tos_version_id": { - "name": "accepted_tos_version_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "accepted_tos_at": { - "name": "accepted_tos_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "user_accepted_tos_version_id_tos_version_id_fk": { - "name": "user_accepted_tos_version_id_tos_version_id_fk", - "tableFrom": "user", - "tableTo": "tos_version", - "columnsFrom": [ - "accepted_tos_version_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "user_name_unique": { - "name": "user_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - }, - "user_email_unique": { - "name": "user_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - }, - "user_unconfirmed_email_unique": { - "name": "user_unconfirmed_email_unique", - "nullsNotDistinct": false, - "columns": [ - "unconfirmed_email" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.location": { - "name": "location", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "location": { - "name": "location", - "type": "geometry(point)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "location_index": { - "name": "location_index", - "columns": [ - { - "expression": "location", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "location_location_unique": { - "name": "location_location_unique", - "nullsNotDistinct": false, - "columns": [ - "location" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.log_entry": { - "name": "log_entry", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.refresh_token": { - "name": "refresh_token", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "refresh_token_user_id_user_id_fk": { - "name": "refresh_token_user_id_user_id_fk", - "tableFrom": "refresh_token", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.token_revocation": { - "name": "token_revocation", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "json", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.claim": { - "name": "claim", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "box_id": { - "name": "box_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "claim_expires_at_idx": { - "name": "claim_expires_at_idx", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "claim_box_id_device_id_fk": { - "name": "claim_box_id_device_id_fk", - "tableFrom": "claim", - "tableTo": "device", - "columnsFrom": [ - "box_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "unique_box_id": { - "name": "unique_box_id", - "nullsNotDistinct": false, - "columns": [ - "box_id" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.integration": { - "name": "integration", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "slug": { - "name": "slug", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "service_url": { - "name": "service_url", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "service_key": { - "name": "service_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "order": { - "name": "order", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "integration_slug_unique": { - "name": "integration_slug_unique", - "nullsNotDistinct": false, - "columns": [ - "slug" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.tos_user_state": { - "name": "tos_user_state", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tos_version_id": { - "name": "tos_version_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "accepted_at": { - "name": "accepted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "tos_user_state_user_idx": { - "name": "tos_user_state_user_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "tos_user_state_user_id_user_id_fk": { - "name": "tos_user_state_user_id_user_id_fk", - "tableFrom": "tos_user_state", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "tos_user_state_tos_version_id_tos_version_id_fk": { - "name": "tos_user_state_tos_version_id_tos_version_id_fk", - "tableFrom": "tos_user_state", - "tableTo": "tos_version", - "columnsFrom": [ - "tos_version_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "tos_user_state_user_id_tos_version_id_pk": { - "name": "tos_user_state_user_id_tos_version_id_pk", - "columns": [ - "user_id", - "tos_version_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.tos_version": { - "name": "tos_version", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "version": { - "name": "version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "body": { - "name": "body", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "accept_by": { - "name": "accept_by", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "tos_version_effective_from_idx": { - "name": "tos_version_effective_from_idx", - "columns": [ - { - "expression": "effective_from", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "tos_version_accept_by_idx": { - "name": "tos_version_accept_by_idx", - "columns": [ - { - "expression": "accept_by", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "tos_version_version_unique": { - "name": "tos_version_version_unique", - "nullsNotDistinct": false, - "columns": [ - "version" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.action_token": { - "name": "action_token", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "action_token_user_purpose_uq": { - "name": "action_token_user_purpose_uq", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "purpose", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "action_token_expires_at_idx": { - "name": "action_token_expires_at_idx", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "action_token_user_id_user_id_fk": { - "name": "action_token_user_id_user_id_fk", - "tableFrom": "action_token", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "action_token_token_hash_unique": { - "name": "action_token_token_hash_unique", - "nullsNotDistinct": false, - "columns": [ - "token_hash" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "public.exposure": { - "name": "exposure", - "schema": "public", - "values": [ - "indoor", - "outdoor", - "mobile", - "unknown" - ] - }, - "public.model": { - "name": "model", - "schema": "public", - "values": [ - "homeV2Lora", - "homeV2Ethernet", - "homeV2Wifi", - "homeEthernet", - "homeWifi", - "homeEthernetFeinstaub", - "homeWifiFeinstaub", - "luftdaten_sds011", - "luftdaten_sds011_dht11", - "luftdaten_sds011_dht22", - "luftdaten_sds011_bmp180", - "luftdaten_sds011_bme280", - "hackair_home_v2", - "senseBox:Edu", - "luftdaten.info", - "custom" - ] - }, - "public.status": { - "name": "status", - "schema": "public", - "values": [ - "active", - "inactive", - "old" - ] - }, - "public.theme_preference": { - "name": "theme_preference", - "schema": "public", - "values": [ - "light", - "dark", - "system" - ] - } - }, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": { - "public.measurement_10min": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_10min", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1day": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1day", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1hour": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1hour", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1month": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1month", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1year": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1year", - "schema": "public", - "isExisting": true, - "materialized": true - } - }, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/app/db/drizzle/meta/0045_snapshot.json b/app/db/drizzle/meta/0045_snapshot.json deleted file mode 100644 index bd55664b7..000000000 --- a/app/db/drizzle/meta/0045_snapshot.json +++ /dev/null @@ -1,1666 +0,0 @@ -{ - "id": "ef9b819e-831a-4fac-8183-8eb681b40a71", - "prevId": "455bb6e0-7317-40b3-9d71-ef56f4443540", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.device": { - "name": "device", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "website": { - "name": "website", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "tags": { - "name": "tags", - "type": "text[]", - "primaryKey": false, - "notNull": false, - "default": "ARRAY[]::text[]" - }, - "link": { - "name": "link", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "use_auth": { - "name": "use_auth", - "type": "boolean", - "primaryKey": false, - "notNull": false - }, - "apiKey": { - "name": "apiKey", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "exposure": { - "name": "exposure", - "type": "exposure", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "model": { - "name": "model", - "type": "model", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'custom'" - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "archived_at": { - "name": "archived_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "orphaned_at": { - "name": "orphaned_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "date", - "primaryKey": false, - "notNull": false - }, - "latitude": { - "name": "latitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "longitude": { - "name": "longitude", - "type": "double precision", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_model": { - "name": "sensor_wiki_model", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "device_user_id_user_id_fk": { - "name": "device_user_id_user_id_fk", - "tableFrom": "device", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.device_to_location": { - "name": "device_to_location", - "schema": "", - "columns": { - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "location_id": { - "name": "location_id", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "device_to_location_device_id_device_id_fk": { - "name": "device_to_location_device_id_device_id_fk", - "tableFrom": "device_to_location", - "tableTo": "device", - "columnsFrom": [ - "device_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - }, - "device_to_location_location_id_location_id_fk": { - "name": "device_to_location_location_id_location_id_fk", - "tableFrom": "device_to_location", - "tableTo": "location", - "columnsFrom": [ - "location_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "device_to_location_device_id_location_id_time_pk": { - "name": "device_to_location_device_id_location_id_time_pk", - "columns": [ - "device_id", - "location_id", - "time" - ] - } - }, - "uniqueConstraints": { - "device_to_location_device_id_location_id_time_unique": { - "name": "device_to_location_device_id_location_id_time_unique", - "nullsNotDistinct": false, - "columns": [ - "device_id", - "location_id", - "time" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.measurement": { - "name": "measurement", - "schema": "", - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "value": { - "name": "value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "location_id": { - "name": "location_id", - "type": "bigint", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "measurement_location_id_location_id_fk": { - "name": "measurement_location_id_location_id_fk", - "tableFrom": "measurement", - "tableTo": "location", - "columnsFrom": [ - "location_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "measurement_sensor_id_time_unique": { - "name": "measurement_sensor_id_time_unique", - "nullsNotDistinct": false, - "columns": [ - "sensor_id", - "time" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.password": { - "name": "password", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": true, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "password_user_id_user_id_fk": { - "name": "password_user_id_user_id_fk", - "tableFrom": "password", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile": { - "name": "profile", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "display_name": { - "name": "display_name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "home_latitude": { - "name": "home_latitude", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "home_longitude": { - "name": "home_longitude", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "home_zoom": { - "name": "home_zoom", - "type": "real", - "primaryKey": false, - "notNull": false, - "default": 10 - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "profile_user_id_user_id_fk": { - "name": "profile_user_id_user_id_fk", - "tableFrom": "profile", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "profile_user_id_unique": { - "name": "profile_user_id_unique", - "nullsNotDistinct": false, - "columns": [ - "user_id" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profile_image": { - "name": "profile_image", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "alt_text": { - "name": "alt_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "content_type": { - "name": "content_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "blob": { - "name": "blob", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "profile_id": { - "name": "profile_id", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "profile_image_profile_id_profile_id_fk": { - "name": "profile_image_profile_id_profile_id_fk", - "tableFrom": "profile_image", - "tableTo": "profile", - "columnsFrom": [ - "profile_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.sensor": { - "name": "sensor", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "unit": { - "name": "unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_type": { - "name": "sensor_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false, - "default": "'inactive'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "sensor_wiki_type": { - "name": "sensor_wiki_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_phenomenon": { - "name": "sensor_wiki_phenomenon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sensor_wiki_unit": { - "name": "sensor_wiki_unit", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "lastMeasurement": { - "name": "lastMeasurement", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "data": { - "name": "data", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "order": { - "name": "order", - "type": "integer", - "primaryKey": false, - "notNull": false, - "default": 0 - } - }, - "indexes": {}, - "foreignKeys": { - "sensor_device_id_device_id_fk": { - "name": "sensor_device_id_device_id_fk", - "tableFrom": "sensor", - "tableTo": "device", - "columnsFrom": [ - "device_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "unconfirmed_email": { - "name": "unconfirmed_email", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "theme_preference": { - "name": "theme_preference", - "type": "theme_preference", - "typeSchema": "public", - "primaryKey": false, - "notNull": true, - "default": "'system'" - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'user'" - }, - "language": { - "name": "language", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'en_US'" - }, - "email_is_confirmed": { - "name": "email_is_confirmed", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "newsletter_opt_in": { - "name": "newsletter_opt_in", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "accepted_tos_version_id": { - "name": "accepted_tos_version_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "accepted_tos_at": { - "name": "accepted_tos_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "user_accepted_tos_version_id_tos_version_id_fk": { - "name": "user_accepted_tos_version_id_tos_version_id_fk", - "tableFrom": "user", - "tableTo": "tos_version", - "columnsFrom": [ - "accepted_tos_version_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "user_name_unique": { - "name": "user_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - }, - "user_email_unique": { - "name": "user_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - }, - "user_unconfirmed_email_unique": { - "name": "user_unconfirmed_email_unique", - "nullsNotDistinct": false, - "columns": [ - "unconfirmed_email" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.location": { - "name": "location", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "bigserial", - "primaryKey": true, - "notNull": true - }, - "location": { - "name": "location", - "type": "geometry(point)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "location_index": { - "name": "location_index", - "columns": [ - { - "expression": "location", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "gist", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "location_location_unique": { - "name": "location_location_unique", - "nullsNotDistinct": false, - "columns": [ - "location" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.log_entry": { - "name": "log_entry", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "public": { - "name": "public", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "device_id": { - "name": "device_id", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.refresh_token": { - "name": "refresh_token", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "refresh_token_user_id_user_id_fk": { - "name": "refresh_token_user_id_user_id_fk", - "tableFrom": "refresh_token", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.token_revocation": { - "name": "token_revocation", - "schema": "", - "columns": { - "hash": { - "name": "hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "json", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.claim": { - "name": "claim", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "box_id": { - "name": "box_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "claim_expires_at_idx": { - "name": "claim_expires_at_idx", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "claim_box_id_device_id_fk": { - "name": "claim_box_id_device_id_fk", - "tableFrom": "claim", - "tableTo": "device", - "columnsFrom": [ - "box_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "unique_box_id": { - "name": "unique_box_id", - "nullsNotDistinct": false, - "columns": [ - "box_id" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.integration": { - "name": "integration", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "slug": { - "name": "slug", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "service_url": { - "name": "service_url", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "service_key": { - "name": "service_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "icon": { - "name": "icon", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "order": { - "name": "order", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "integration_slug_unique": { - "name": "integration_slug_unique", - "nullsNotDistinct": false, - "columns": [ - "slug" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.tos_user_state": { - "name": "tos_user_state", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "tos_version_id": { - "name": "tos_version_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "accepted_at": { - "name": "accepted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "tos_user_state_user_idx": { - "name": "tos_user_state_user_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "tos_user_state_user_id_user_id_fk": { - "name": "tos_user_state_user_id_user_id_fk", - "tableFrom": "tos_user_state", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "tos_user_state_tos_version_id_tos_version_id_fk": { - "name": "tos_user_state_tos_version_id_tos_version_id_fk", - "tableFrom": "tos_user_state", - "tableTo": "tos_version", - "columnsFrom": [ - "tos_version_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "tos_user_state_user_id_tos_version_id_pk": { - "name": "tos_user_state_user_id_tos_version_id_pk", - "columns": [ - "user_id", - "tos_version_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.tos_version": { - "name": "tos_version", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "version": { - "name": "version", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "body": { - "name": "body", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "effective_from": { - "name": "effective_from", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "accept_by": { - "name": "accept_by", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "tos_version_effective_from_idx": { - "name": "tos_version_effective_from_idx", - "columns": [ - { - "expression": "effective_from", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "tos_version_accept_by_idx": { - "name": "tos_version_accept_by_idx", - "columns": [ - { - "expression": "accept_by", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "tos_version_version_unique": { - "name": "tos_version_version_unique", - "nullsNotDistinct": false, - "columns": [ - "version" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.action_token": { - "name": "action_token", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "purpose": { - "name": "purpose", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token_hash": { - "name": "token_hash", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "action_token_user_purpose_uq": { - "name": "action_token_user_purpose_uq", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "purpose", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "concurrently": false, - "method": "btree", - "with": {} - }, - "action_token_expires_at_idx": { - "name": "action_token_expires_at_idx", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "action_token_user_id_user_id_fk": { - "name": "action_token_user_id_user_id_fk", - "tableFrom": "action_token", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "action_token_token_hash_unique": { - "name": "action_token_token_hash_unique", - "nullsNotDistinct": false, - "columns": [ - "token_hash" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "public.exposure": { - "name": "exposure", - "schema": "public", - "values": [ - "indoor", - "outdoor", - "mobile", - "unknown" - ] - }, - "public.model": { - "name": "model", - "schema": "public", - "values": [ - "homeV2Lora", - "homeV2Ethernet", - "homeV2Wifi", - "homeEthernet", - "homeWifi", - "homeEthernetFeinstaub", - "homeWifiFeinstaub", - "luftdaten_sds011", - "luftdaten_sds011_dht11", - "luftdaten_sds011_dht22", - "luftdaten_sds011_bmp180", - "luftdaten_sds011_bme280", - "hackair_home_v2", - "senseBox:Edu", - "luftdaten.info", - "custom" - ] - }, - "public.status": { - "name": "status", - "schema": "public", - "values": [ - "active", - "inactive", - "old" - ] - }, - "public.theme_preference": { - "name": "theme_preference", - "schema": "public", - "values": [ - "light", - "dark", - "system" - ] - } - }, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": { - "public.measurement_10min": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_10min", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1day": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1day", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1hour": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1hour", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1month": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1month", - "schema": "public", - "isExisting": true, - "materialized": true - }, - "public.measurement_1year": { - "columns": { - "sensor_id": { - "name": "sensor_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "time": { - "name": "time", - "type": "timestamp (3) with time zone", - "primaryKey": false, - "notNull": false - }, - "avg_value": { - "name": "avg_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "total_values": { - "name": "total_values", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "min_value": { - "name": "min_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "max_value": { - "name": "max_value", - "type": "double precision", - "primaryKey": false, - "notNull": false - } - }, - "name": "measurement_1year", - "schema": "public", - "isExisting": true, - "materialized": true - } - }, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/app/db/drizzle/meta/_journal.json b/app/db/drizzle/meta/_journal.json deleted file mode 100644 index 76c934ac1..000000000 --- a/app/db/drizzle/meta/_journal.json +++ /dev/null @@ -1,328 +0,0 @@ -{ - "version": "5", - "dialect": "pg", - "entries": [ - { - "idx": 0, - "version": "5", - "when": 1718182331021, - "tag": "0000_whole_jamie_braddock", - "breakpoints": true - }, - { - "idx": 1, - "version": "5", - "when": 1718182338684, - "tag": "0001_watery_wolverine", - "breakpoints": true - }, - { - "idx": 2, - "version": "5", - "when": 1718182367858, - "tag": "0002_exotic_morbius", - "breakpoints": true - }, - { - "idx": 3, - "version": "5", - "when": 1719827481306, - "tag": "0003_plain_la_nuit", - "breakpoints": true - }, - { - "idx": 4, - "version": "5", - "when": 1719832678388, - "tag": "0004_warm_triathlon", - "breakpoints": true - }, - { - "idx": 5, - "version": "5", - "when": 1720775038176, - "tag": "0005_lying_riptide", - "breakpoints": true - }, - { - "idx": 6, - "version": "7", - "when": 1722275512453, - "tag": "0006_wealthy_fat_cobra", - "breakpoints": true - }, - { - "idx": 7, - "version": "7", - "when": 1728981072442, - "tag": "0007_add_entryLogs", - "breakpoints": true - }, - { - "idx": 8, - "version": "7", - "when": 1729065392478, - "tag": "0008_add_deviceTags", - "breakpoints": true - }, - { - "idx": 9, - "version": "7", - "when": 1730191962488, - "tag": "0009_add_postgis", - "breakpoints": true - }, - { - "idx": 10, - "version": "7", - "when": 1730192030008, - "tag": "0010_add_locations", - "breakpoints": true - }, - { - "idx": 11, - "version": "7", - "when": 1732793261789, - "tag": "0011_delete_device_location", - "breakpoints": true - }, - { - "idx": 12, - "version": "7", - "when": 1733819006789, - "tag": "0012_define_device_models", - "breakpoints": true - }, - { - "idx": 13, - "version": "7", - "when": 1734092303665, - "tag": "0013_add_tempoary_devices", - "breakpoints": true - }, - { - "idx": 14, - "version": "7", - "when": 1734094141250, - "tag": "0014_cron_delete_temporary_devices", - "breakpoints": true - }, - { - "idx": 15, - "version": "7", - "when": 1738064256275, - "tag": "0015_cynical_thanos", - "breakpoints": true - }, - { - "idx": 16, - "version": "7", - "when": 1747839417161, - "tag": "0016_watery_cassandra_nova", - "breakpoints": true - }, - { - "idx": 17, - "version": "7", - "when": 1747984468184, - "tag": "0017_slimy_the_executioner", - "breakpoints": true - }, - { - "idx": 18, - "version": "7", - "when": 1748253218694, - "tag": "0018_dazzling_tattoo", - "breakpoints": true - }, - { - "idx": 19, - "version": "7", - "when": 1748350163331, - "tag": "0019_uneven_silver_surfer", - "breakpoints": true - }, - { - "idx": 20, - "version": "7", - "when": 1748352273109, - "tag": "0020_cloudy_misty_knight", - "breakpoints": true - }, - { - "idx": 21, - "version": "7", - "when": 1759928743654, - "tag": "0021_tense_sir_ram", - "breakpoints": true - }, - { - "idx": 22, - "version": "7", - "when": 1761122113831, - "tag": "0022_odd_sugar_man", - "breakpoints": true - }, - { - "idx": 23, - "version": "7", - "when": 1765380754120, - "tag": "0023_check_location", - "breakpoints": true - }, - { - "idx": 24, - "version": "7", - "when": 1767972133643, - "tag": "0024_first_kitty_pryde", - "breakpoints": true - }, - { - "idx": 25, - "version": "7", - "when": 1768585075372, - "tag": "0025_check-location-update", - "breakpoints": true - }, - { - "idx": 26, - "version": "7", - "when": 1768990588627, - "tag": "0026_misty_switch", - "breakpoints": true - }, - { - "idx": 27, - "version": "7", - "when": 1769504123613, - "tag": "0027_ambiguous_mariko_yashida", - "breakpoints": true - }, - { - "idx": 28, - "version": "7", - "when": 1769504950323, - "tag": "0028_gigantic_deadpool", - "breakpoints": true - }, - { - "idx": 29, - "version": "7", - "when": 1770285162055, - "tag": "0029_plain_black_widow", - "breakpoints": true - }, - { - "idx": 30, - "version": "7", - "when": 1770303921106, - "tag": "0030_parallel_toxin", - "breakpoints": true - }, - { - "idx": 31, - "version": "7", - "when": 1771327793809, - "tag": "0031_silly_the_call", - "breakpoints": true - }, - { - "idx": 32, - "version": "7", - "when": 1771332110325, - "tag": "0032_equal_young_avengers", - "breakpoints": true - }, - { - "idx": 33, - "version": "7", - "when": 1772009671134, - "tag": "0033_caag-retention-policies", - "breakpoints": true - }, - { - "idx": 34, - "version": "7", - "when": 1773409031174, - "tag": "0034_moaning_ironclad", - "breakpoints": true - }, - { - "idx": 35, - "version": "7", - "when": 1773743434472, - "tag": "0035_known_wiccan", - "breakpoints": true - }, - { - "idx": 36, - "version": "7", - "when": 1773831932460, - "tag": "0036_even_power_man", - "breakpoints": true - }, - { - "idx": 37, - "version": "7", - "when": 1774265394334, - "tag": "0037_amused_bullseye", - "breakpoints": true - }, - { - "idx": 38, - "version": "7", - "when": 1774424378854, - "tag": "0038_peaceful_the_enforcers", - "breakpoints": true - }, - { - "idx": 39, - "version": "7", - "when": 1774424856884, - "tag": "0039_simple_wallow", - "breakpoints": true - }, - { - "idx": 40, - "version": "7", - "when": 1774432426934, - "tag": "0040_luxuriant_mathemanic", - "breakpoints": true - }, - { - "idx": 41, - "version": "7", - "when": 1774433429827, - "tag": "0041_cleanup_expired_tos_users", - "breakpoints": true - }, - { - "idx": 42, - "version": "7", - "when": 1778596447793, - "tag": "0042_medical_blackheart", - "breakpoints": true - }, - { - "idx": 43, - "version": "7", - "when": 1781082106170, - "tag": "0043_flowery_bedlam", - "breakpoints": true - }, - { - "idx": 44, - "version": "7", - "when": 1781707403150, - "tag": "0044_dusty_ultragirl", - "breakpoints": true - }, - { - "idx": 45, - "version": "7", - "when": 1782121660841, - "tag": "0045_blushing_chameleon", - "breakpoints": true - } - ] -} \ No newline at end of file