Skip to content

Commit

Permalink
feat: initial memo store
Browse files Browse the repository at this point in the history
  • Loading branch information
boojack committed Dec 10, 2023
1 parent 5c3df55 commit add523f
Show file tree
Hide file tree
Showing 7 changed files with 637 additions and 0 deletions.
43 changes: 43 additions & 0 deletions proto/gen/store/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
- [store/collection.proto](#store_collection-proto)
- [Collection](#slash-store-Collection)

- [store/memo.proto](#store_memo-proto)
- [Memo](#slash-store-Memo)

- [store/shortcut.proto](#store_shortcut-proto)
- [OpenGraphMetadata](#slash-store-OpenGraphMetadata)
- [Shortcut](#slash-store-Shortcut)
Expand Down Expand Up @@ -168,6 +171,46 @@



<a name="store_memo-proto"></a>
<p align="right"><a href="#top">Top</a></p>

## store/memo.proto



<a name="slash-store-Memo"></a>

### Memo



| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [int32](#int32) | | |
| creator_id | [int32](#int32) | | |
| created_ts | [int64](#int64) | | |
| updated_ts | [int64](#int64) | | |
| row_status | [RowStatus](#slash-store-RowStatus) | | |
| name | [string](#string) | | |
| title | [string](#string) | | |
| content | [string](#string) | | |
| tags | [string](#string) | repeated | |
| visibility | [Visibility](#slash-store-Visibility) | | |















<a name="store_shortcut-proto"></a>
<p align="right"><a href="#top">Top</a></p>

Expand Down
247 changes: 247 additions & 0 deletions proto/gen/store/memo.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions proto/store/memo.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
syntax = "proto3";

package slash.store;

import "store/common.proto";

option go_package = "gen/store";

message Memo {
int32 id = 1;

int32 creator_id = 2;

int64 created_ts = 3;

int64 updated_ts = 4;

RowStatus row_status = 5;

string name = 6;

string title = 7;

string content = 8;

repeated string tags = 9;

Visibility visibility = 10;
}
16 changes: 16 additions & 0 deletions store/db/migration/dev/LATEST__SCHEMA.sql
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,19 @@ CREATE TABLE collection (
);

CREATE INDEX idx_collection_name ON collection(name);

-- memo
CREATE TABLE memo (
id INTEGER PRIMARY KEY AUTOINCREMENT,
creator_id INTEGER NOT NULL,
created_ts BIGINT NOT NULL DEFAULT (strftime('%s', 'now')),
updated_ts BIGINT NOT NULL DEFAULT (strftime('%s', 'now')),
row_status TEXT NOT NULL CHECK (row_status IN ('NORMAL', 'ARCHIVED')) DEFAULT 'NORMAL',
name TEXT NOT NULL UNIQUE,
title TEXT NOT NULL DEFAULT '',
content TEXT NOT NULL DEFAULT '',
visibility TEXT NOT NULL CHECK (visibility IN ('PRIVATE', 'WORKSPACE', 'PUBLIC')) DEFAULT 'PRIVATE',
tag TEXT NOT NULL DEFAULT ''
);

CREATE INDEX idx_memo_name ON memo(name);
Loading

0 comments on commit add523f

Please sign in to comment.