Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

S3 to Turso database #298

Merged
merged 25 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
NEXT_PUBLIC_NODE_ENV=$NODE_ENV
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@ yarn-error.log*
output.png
public/cloud-assets
local.db
local.sql
2 changes: 2 additions & 0 deletions ONSITE_SETUP.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
> NEEDS UPDATE

# Onsite setup

This is the one stop shop for everything related to setting up Conjurer. Just followed these 47 easy steps. What could go wrong?
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ This is a big React app, hastily designed, that's doing a lot of expensive CPU/G

## Todos

To dos are captured in the [wiki](https://github.com/SotSF/conjurer/wiki), and occasionally are captured as issues.
To dos are captured as issues. Feel free to poke around the open issues, ask questions, and open a PR if you feel so inclined.

## Contributing

Please do! This is a group effort, and any help is welcome.
Please do! This is a group effort, and any help is welcome. Feature ideas or bug reports via issues would be great.
2 changes: 1 addition & 1 deletion docs/patterns.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# How to make a pattern

Let's create a pattern called Blah. The goal will be to create a barebones pattern that we can get to hot reload as we make changes to the shader. This way, w can immediately see the effects of our cool complicated maths. Yay!
Let's create a pattern called Blah. The goal will be to create a barebones pattern that we can get to hot reload as we make changes to the shader. This way, we can immediately see the effects of our cool complicated maths. Yay!

1. Follow the usual steps to install dependencies and run the dev server:

Expand Down
Original file line number Diff line number Diff line change
@@ -1,44 +1,43 @@
CREATE TABLE `authorship` (
`id` integer PRIMARY KEY NOT NULL,
`user_id` integer NOT NULL,
`experience_id` integer NOT NULL,
`created_at` text DEFAULT (CURRENT_TIMESTAMP) NOT NULL,
`updated_at` integer,
FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE cascade,
FOREIGN KEY (`experience_id`) REFERENCES `experiences`(`id`) ON UPDATE no action ON DELETE cascade
);
--> statement-breakpoint
CREATE UNIQUE INDEX `experience_author_index` ON `authorship` (`user_id`,`experience_id`);--> statement-breakpoint
CREATE TABLE `experiences` (
`id` integer PRIMARY KEY NOT NULL,
`name` text NOT NULL,
`song_id` integer NOT NULL,
`status` text DEFAULT 'inprogress',
`data` text,
`version` integer DEFAULT 0,
`status` text DEFAULT 'inprogress' NOT NULL,
`data` text NOT NULL,
`version` integer DEFAULT 0 NOT NULL,
`created_at` text DEFAULT (CURRENT_TIMESTAMP) NOT NULL,
`updated_at` integer,
FOREIGN KEY (`song_id`) REFERENCES `songs`(`id`) ON UPDATE no action ON DELETE cascade
`updated_at` text DEFAULT (CURRENT_TIMESTAMP) NOT NULL
);
--> statement-breakpoint
CREATE UNIQUE INDEX `experiences_name_unique` ON `experiences` (`name`);--> statement-breakpoint
CREATE INDEX `status_index` ON `experiences` (`status`);--> statement-breakpoint
CREATE TABLE `songs` (
`id` integer PRIMARY KEY NOT NULL,
`name` text NOT NULL,
`artist` text DEFAULT '',
`s3_path` text NOT NULL,
`artist` text DEFAULT '' NOT NULL,
`filename` text NOT NULL,
`created_at` text DEFAULT (CURRENT_TIMESTAMP) NOT NULL,
`updated_at` integer
`updated_at` text DEFAULT (CURRENT_TIMESTAMP) NOT NULL
);
--> statement-breakpoint
CREATE UNIQUE INDEX `song_name_artist_index` ON `songs` (`artist`,`name`);--> statement-breakpoint
CREATE TABLE `users` (
`id` integer PRIMARY KEY NOT NULL,
`username` text NOT NULL,
`is_admin` integer DEFAULT false,
`is_admin` integer DEFAULT false NOT NULL,
`created_at` text DEFAULT (CURRENT_TIMESTAMP) NOT NULL,
`updated_at` integer
`updated_at` text DEFAULT (CURRENT_TIMESTAMP) NOT NULL
);
--> statement-breakpoint
CREATE UNIQUE INDEX `users_username_unique` ON `users` (`username`);--> statement-breakpoint
CREATE TABLE `users_to_experiences` (
`id` integer PRIMARY KEY NOT NULL,
`user_id` integer NOT NULL,
`experience_id` integer NOT NULL,
`created_at` text DEFAULT (CURRENT_TIMESTAMP) NOT NULL,
`updated_at` text DEFAULT (CURRENT_TIMESTAMP) NOT NULL,
FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE cascade,
FOREIGN KEY (`experience_id`) REFERENCES `experiences`(`id`) ON UPDATE no action ON DELETE cascade
);
--> statement-breakpoint
CREATE UNIQUE INDEX `users_username_unique` ON `users` (`username`);
CREATE UNIQUE INDEX `user_experience_index` ON `users_to_experiences` (`user_id`,`experience_id`);
216 changes: 103 additions & 113 deletions migrations/meta/0000_snapshot.json
Original file line number Diff line number Diff line change
@@ -1,90 +1,9 @@
{
"version": "6",
"dialect": "sqlite",
"id": "d1347104-5689-4731-b09f-86ebbdcd9a96",
"id": "1185bae5-5133-4d1b-bb63-d0daf1e9a784",
"prevId": "00000000-0000-0000-0000-000000000000",
"tables": {
"authorship": {
"name": "authorship",
"columns": {
"id": {
"name": "id",
"type": "integer",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"user_id": {
"name": "user_id",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"experience_id": {
"name": "experience_id",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"created_at": {
"name": "created_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "(CURRENT_TIMESTAMP)"
},
"updated_at": {
"name": "updated_at",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false
}
},
"indexes": {
"experience_author_index": {
"name": "experience_author_index",
"columns": [
"user_id",
"experience_id"
],
"isUnique": true
}
},
"foreignKeys": {
"authorship_user_id_users_id_fk": {
"name": "authorship_user_id_users_id_fk",
"tableFrom": "authorship",
"tableTo": "users",
"columnsFrom": [
"user_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"authorship_experience_id_experiences_id_fk": {
"name": "authorship_experience_id_experiences_id_fk",
"tableFrom": "authorship",
"tableTo": "experiences",
"columnsFrom": [
"experience_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
},
"experiences": {
"name": "experiences",
"columns": {
Expand Down Expand Up @@ -113,22 +32,22 @@
"name": "status",
"type": "text",
"primaryKey": false,
"notNull": false,
"notNull": true,
"autoincrement": false,
"default": "'inprogress'"
},
"data": {
"name": "data",
"type": "text",
"primaryKey": false,
"notNull": false,
"notNull": true,
"autoincrement": false
},
"version": {
"name": "version",
"type": "integer",
"primaryKey": false,
"notNull": false,
"notNull": true,
"autoincrement": false,
"default": 0
},
Expand All @@ -142,10 +61,11 @@
},
"updated_at": {
"name": "updated_at",
"type": "integer",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
"notNull": true,
"autoincrement": false,
"default": "(CURRENT_TIMESTAMP)"
}
},
"indexes": {
Expand All @@ -164,21 +84,7 @@
"isUnique": false
}
},
"foreignKeys": {
"experiences_song_id_songs_id_fk": {
"name": "experiences_song_id_songs_id_fk",
"tableFrom": "experiences",
"tableTo": "songs",
"columnsFrom": [
"song_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
},
Expand All @@ -203,12 +109,12 @@
"name": "artist",
"type": "text",
"primaryKey": false,
"notNull": false,
"notNull": true,
"autoincrement": false,
"default": "''"
},
"s3_path": {
"name": "s3_path",
"filename": {
"name": "filename",
"type": "text",
"primaryKey": false,
"notNull": true,
Expand All @@ -224,10 +130,11 @@
},
"updated_at": {
"name": "updated_at",
"type": "integer",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
"notNull": true,
"autoincrement": false,
"default": "(CURRENT_TIMESTAMP)"
}
},
"indexes": {
Expand Down Expand Up @@ -265,7 +172,7 @@
"name": "is_admin",
"type": "integer",
"primaryKey": false,
"notNull": false,
"notNull": true,
"autoincrement": false,
"default": false
},
Expand All @@ -279,10 +186,11 @@
},
"updated_at": {
"name": "updated_at",
"type": "integer",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
"notNull": true,
"autoincrement": false,
"default": "(CURRENT_TIMESTAMP)"
}
},
"indexes": {
Expand All @@ -297,6 +205,88 @@
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
},
"users_to_experiences": {
"name": "users_to_experiences",
"columns": {
"id": {
"name": "id",
"type": "integer",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"user_id": {
"name": "user_id",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"experience_id": {
"name": "experience_id",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"created_at": {
"name": "created_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "(CURRENT_TIMESTAMP)"
},
"updated_at": {
"name": "updated_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "(CURRENT_TIMESTAMP)"
}
},
"indexes": {
"user_experience_index": {
"name": "user_experience_index",
"columns": [
"user_id",
"experience_id"
],
"isUnique": true
}
},
"foreignKeys": {
"users_to_experiences_user_id_users_id_fk": {
"name": "users_to_experiences_user_id_users_id_fk",
"tableFrom": "users_to_experiences",
"tableTo": "users",
"columnsFrom": [
"user_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"users_to_experiences_experience_id_experiences_id_fk": {
"name": "users_to_experiences_experience_id_experiences_id_fk",
"tableFrom": "users_to_experiences",
"tableTo": "experiences",
"columnsFrom": [
"experience_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
}
},
"enums": {},
Expand Down
Loading
Loading