<!-- Generated by SpecStory -->

# Fixing property error in PgColumn (2025-06-26 22:40:06)

_**User**_

For the code present, we get this error:
```
Property 'add' does not exist on type 'PgColumn<{ name: "views"; tableName: "views"; dataType: "number"; columnType: "PgInteger"; data: number; driverParam: string | number; notNull: true; hasDefault: true; isPrimaryKey: false; isAutoincrement: false; ... 4 more ...; generated: undefined; }, {}, {}>'.
```
How can I resolve this? If you propose a fix, please make it concise.

---

_**Assistant**_

Looking at the error, the issue is that `views.views.add(1)` is not valid Drizzle ORM syntax. In Drizzle, you need to use the `sql` helper for arithmetic operations.

Let me check the schemas to understand the structure better and provide the correct fix:

---

Read file: apps/ssr/src/schemas/view.ts

---

Now I can see the schema. The fix is to use Drizzle's `sql` helper for the increment operation:

---



---

The fix is simple:

1. Import `sql` from `drizzle-orm`
2. Replace `views.views.add(1)` with `sql`${views.views} + 1`` 

This uses Drizzle's SQL template literal syntax to safely increment the views column by 1. The `sql` helper allows you to write raw SQL expressions while still maintaining type safety and proper escaping.

---

