Created
May 30, 2024 13:54
-
-
Save vaso991/ad5df41cc626c3e8eef59894b39e6a37 to your computer and use it in GitHub Desktop.
Drizzle Postgis
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { pgTable, serial, varchar, timestamp } from "drizzle-orm/pg-core"; | |
import { models } from 'drizzle-postgis'; | |
export const users = pgTable('users', { | |
id: serial('id').primaryKey(), | |
name: varchar('name', { length: 50 }), | |
location: models.point('location', { srid: 4326 }), | |
createdAt: timestamp('createdAt').notNull().defaultNow(), | |
updatedAt: timestamp('updatedAt').notNull().defaultNow().$onUpdate(() => new Date()) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment