Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/willnode/oneform
Browse files Browse the repository at this point in the history
  • Loading branch information
willnode committed Jul 26, 2024
2 parents 7355b5b + acd935b commit 62bf4d3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion drizzle.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default defineConfig({
dbCredentials: {
user: process.env.DB_USERNAME || 'root',
password: process.env.DB_PASSWORD || '',
host: process.env.DB_HOST || 'localhost',
host: process.env.DB_HOST || '127.0.0.1' || 'localhost',
port: parseInt(process.env.DB_PORT || '3306'),
database: process.env.DB_NAME || 'oneform_db',
},
Expand Down
6 changes: 3 additions & 3 deletions src/db/schema.mysql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const UserAuth = mysqlTable("user_auth", {
id: varchar("id", { length: 26 }).primaryKey(),
userId: varchar("user_id", { length: 26 }).references(() => User.id).notNull(),
type: varchar("type", { length: 255 }).notNull(),
identifier: varchar("identifier", { length: 1024 }).notNull(),
identifier: varchar("identifier", { length: 256 }).notNull(),
},
(table) => {
return {
Expand Down Expand Up @@ -48,7 +48,7 @@ export const Form = mysqlTable("form", {
export const View = mysqlTable("view", {
id: varchar("id", { length: 26 }).primaryKey(),
teamId: varchar("team_id", { length: 26 }).references(() => Team.id).notNull(),
route: varchar("route", { length: 1024 }).notNull().unique(),
route: varchar("route", { length: 256 }).notNull().unique(),
title: text("title").notNull(),
schema: json("schema"),
config: json("config"),
Expand All @@ -60,7 +60,7 @@ export const View = mysqlTable("view", {
export const ViewComponent = mysqlTable("view_component", {
id: varchar("id", { length: 26 }).primaryKey(),
teamId: varchar("team_id", { length: 26 }).references(() => Team.id).notNull(),
identifier: varchar("identifier", { length: 1024 }).notNull().unique(),
identifier: varchar("identifier", { length: 256 }).notNull().unique(),
title: text("title").notNull(),
schema: text("schema"),
config: text("config"),
Expand Down
10 changes: 5 additions & 5 deletions src/lib/db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import {migrate} from 'drizzle-orm/mysql2/migrator';
import * as schema from '@/db/schema';
import mysql from 'mysql2/promise';
const mySqlConfig = {
host: import.meta.env.DB_HOST || 'localhost',
user: import.meta.env.DB_USERNAME || 'root',
password: import.meta.env.DB_PASSWORD || '',
database: import.meta.env.DB_NAME || 'oneform_db',
port: parseInt(import.meta.env.DB_PORT || '3306'),
host: process.env.DB_HOST || '127.0.0.1' || 'localhost',
user: process.env.DB_USER || 'root',
password: process.env.DB_PASSWORD || '',
database: process.env.DB_NAME || 'oneform_db',
port: parseInt(process.env.DB_PORT || '3306'),
};

const sql = mysql.createPool(mySqlConfig);
Expand Down

0 comments on commit 62bf4d3

Please sign in to comment.