Commit Graph

18 Commits

Author SHA1 Message Date
Luna Mendes 28f33b0a95 schema: change premium to premium_since
sql for instances:

```sql
-- remove old nitro column
ALTER TABLE users DROP COLUMN premium;

-- add new nitro column
ALTER TABLE users ADD COLUMN premium_since timestamp without time zone DEFAULT NULL;
```
2018-10-10 19:13:59 -03:00
Luna Mendes 737129bd20 blueprints.channels: fix channel deletion
- blueprints.guilds: fix channel creation
 - blueprints.relationships: add POST /api/v6/users/@me/relationships
 - storage: add Storage.search_user, for ^
 - storage: fix bug with last_message_id returning "None" (as a str)
2018-10-10 17:09:39 -03:00
Luna Mendes adc6a58179 blueprints.channels: add channel and guild ack routes
SQL for instances: Rerun `schema.sql` for the new table.

 - gateway.websocket: add get_read_state to read_state's ready
 - gateway.websocket: add get_dms on private_channels' ready
 - storage: fix get_dms()
 - storage: add Storage.get_channel_ids()
 - storage: add Storage.get_read_state()
 - schema.sql: add user_read_state table
2018-10-09 22:52:12 -03:00
Luna Mendes 0ebbc4cd37 schema.sql: add UNIQUE to dm_channels
This should fix the `schema.sql` errors on 61e36f244b.

```sql
DROP TABLE dm_channels;
```

Then rerun `schema.sql`.
2018-10-03 22:11:07 -03:00
Luna Mendes 61e36f244b blueprints.users, channels: basic dm operations
SQL for instances:

```sql
ALTER TABLE messages
ADD CONSTRAINT messages_channels_fkey
FOREIGN KEY (channel_id)
REFERENCES channels (id)
ON DELETE CASCADE;

ALTER TABLE channel_pins ADD CONSTRAINT pins_channels_fkey
FOREIGN KEY (channel_id)
REFERENCES channels (id)
ON DELETE CASCADE;

ALTER TABLE channel_pins ADD CONSTRAINT pins_messages_fkey
FOREIGN KEY (message_id)
REFERENCES messages (id)
ON DELETE CASCADE;
```

After that, rerun `schema.sql`.

blueprints.channels:
 - check dms on channel_check
 - add DELETE /api/v6/channels/<int:channel_id>

blueprints.users:
 - add event dispatching for leaving guilds
 - add GET /api/v6/users/@me/channels, for DM fetching
 - add POST /api/v6/users/@me/channels, for DM creation
 - add POST /api/v6/users/<int:user_id>/channels for DM / Group DM
    creation

 - schemas: add CREATE, CREATE_GROUP_DM
 - storage: add last_message_id fetching for channels
 - storage: add support for DMs in get_channel
 - storage: add Storage.get_dm, Storage.get_dms, Storage.get_all_dms
 - schema.sql: add dm_channel_state table
 - schema.sql: add constriants for messages.channel_id and channel_pins
2018-10-03 21:49:35 -03:00
Luna Mendes fcddd46d47 schema.sql: add draft for dm_channels
also add name to group_dm_channels, and a group_dm_members table.

SQL for moving to latest schema:

```sql
DROP TABLE dm_channels;
DROP TABLE group_dm_channels;
DROP TABLE channel_overwrites;
DROP TABLE guild_features;
```

Then rerun `schema.sql`.

 - schema.sql: revamp channel_overwrites table
 - schema.sql: add features table
 - schema.sql: make guild_features use the features table
2018-10-02 17:56:20 -03:00
Luna Mendes d7cc5568bc schema.sql: fix possible bug with some message tables
Drop the unused tables:
```sql
DROP TABLE message_attachments;
DROP TABLE message_reactions;
DROP TABLE channel_pins;
```

Rerun `schema.sql` to recreate them with the proper constraints.
2018-10-02 16:51:01 -03:00
Luna Mendes c7923da124 relationship support!
friendships and blocks are possible, however presence code isn't ready
to handle presences of people who are friends.

SQL for instances, this is going to fix bad timestamps on the messages:

```sql
ALTER TABLE ONLY members ALTER COLUMN joined_at SET DEFAULT (now() at time zone 'utc');
 ALTER TABLE ONLY messages ALTER COLUMN created_at SET DEFAULT (now() at time zone 'utc');
ALTER TABLE ONLY invites ALTER COLUMN created_at SET DEFAULT (now() at time zone 'utc');
```

After that, rerun the schema.sql file to have the new relationships
table.

 - blueprints: add relationships blueprint
 - enums: add RelationshipType
 - storage: add get_relationships
 - storage: fix bug on lazy guild changes and messages
 - schemas: return validator.document instead of reqjson
 - gateway.websocket: use Storage.get_relationships
2018-10-02 03:43:57 -03:00
Luna Mendes 4841565f14 schema.sql: add user_settings table
rerunning the schema.sql file should get you up and running.

 - add POST /api/v6/users/@me/consent for consent changes (that get
    ignored)
2018-09-29 22:17:10 -03:00
Luna Mendes d9506f450d schema.sql: change from varchar to text on some fields
unicode!

sql for instances to upgrade:

alter table users alter column username type text;
alter table guilds alter column name type text;
alter table members alter column nickname type text;
alter table roles alter column name type text;
alter table bans alter column reason type text;
2018-09-28 00:54:24 -03:00
Luna Mendes 3858e20080 Add user notes
- blueprints.users: fix get_other
 - blueprints.users: add dummy get_user_settings,
     patch_current_settings, get_consent, get_harvest and get_library
 - enums: add ExplicitFilter
 - storage: add Storage.fetch_notes
 - schema.sql: add incomplete user_settings table
2018-09-22 20:18:48 -03:00
Luna Mendes 545d261bdd schema.sql: fix syntax 2018-07-06 02:29:17 -03:00
Luna Mendes 0ca45c781e blueprints.channels: add implementations for some routes
more specifically edit/delete message, and all 3 pin-related routes.

 - snowflake: add snowflake_datetime
2018-07-04 17:40:27 -03:00
Luna Mendes 2276308c5d blueprints.guild: use guild_id = role_id on at-everyone's role
- gateway.websocket: add user_ready function
 - storage: add guild_id by default on member roles
 - storage: add get_role_data
 - schema.sql: change default color from 0 to 1
2018-06-23 21:18:19 -03:00
Luna Mendes de98d0f609 blueprints.guild: use EventDispatcher
- dispatcher: add sub_guild, unsub_guild, remove_guild, dispatch_guild
 - gateway.state_manager: fix fetch_states
 - gateway.websocket: add current_shard, shard_count to atributes
 - schema: add ON DELETE CASCADE to channel tables
2018-06-21 17:59:08 -03:00
Luna Mendes 3eb6d5e60f litecord: add Storage
Storage serves as a way to reduce code repeatbility. So that we
don't need to keep repeating the same SQL statements over and over,
and to detach some SQL calls into their own code (like guild fetching)

 - gateway.websocket: add WebsocketObjects to hold db, state_manager,
    storage and loop

 - gateway.websocket: add _make_guild_list
 - schema: add members.deafened, members.muted
2018-06-20 16:53:22 -03:00
Luna Mendes f7f387dcf0 litecord.blueprints: add auth blueprint
- Pipfile: add bcrypt and itsdangerous
 - litecord: add errors module
 - litecord: add snowflake module
 - run: add error handlers

 - schema: add UNIQUE constraint to users.email
   - remove users.password_salt
2018-06-17 04:09:29 -03:00
Luna Mendes c11851c4b0 add schema.sql
- add basic config example stuff
2018-06-16 19:25:07 -03:00