Code Monkey home page Code Monkey logo

Comments (6)

StephixOne avatar StephixOne commented on June 14, 2024 1

Posting what the issue was in case other people will be looking to host their own and run into a similar thing or attempt the same things. As I was suspecting above, my method of using sqlalchemy to create the table did not make the timestamp columns tz-aware. Dropped the table created that way, used the db connection script in /scripts and created one with this shape:

CREATE TABLE "Users"(
id serial PRIMARY KEY,
"slackId" VARCHAR(255) NOT NULL,
"slackAccessToken" VARCHAR(255) NOT NULL,
"spotifyId" VARCHAR(255) NOT NULL,
"spotifyExpiresAt" TIMESTAMPTZ NOT NULL,
"spotifyAccessToken" VARCHAR(255) NOT NULL,
"spotifyRefreshToken" VARCHAR(255),
"createdAt" TIMESTAMPTZ NOT NULL,
"updatedAt" TIMESTAMPTZ NOT NULL,
"statusSetLastTime" BOOLEAN DEFAULT FALSE,
"useCustomEmojis" BOOLEAN DEFAULT TRUE);

Everything seems in order now ! 👍

from spotify-my-slack.

micthiesen avatar micthiesen commented on June 14, 2024

Hey, the app is built to expect timezone-aware datetimes everywhere. Maybe the datetimes you have in the database are not timezone-aware? I would go in the direction of trying to make everything timezone-aware rather than timezone-unaware.

Note that I was in the middle of refactoring the backend (from Node.js to Python) when I stopped working on the project. So there may be bugs, in the update loop for example. There are also no migrations for the database right now, so you'd have to either set up Alembic (which I want to do eventually) or create the initial tables manually.

One other approach, if you just want to get something working, would be to check out a version of the repository that was still using Node.js for the backend. That version has migrations and should be more robust (in certain ways). You can probably see when I started refactoring the backend fairly easily in the git history. Good luck!

from spotify-my-slack.

StephixOne avatar StephixOne commented on June 14, 2024

Thanks for the reply! I got around the no migration issue by using scripts/shell_backend.sh, importing engine from sqlalchemy then doing a METADATA.create_all(engine) which seemed to give me the User table. However, I'm now thinking that maybe this method created improperly-timezone-aware fields, so I'll have a look into that. If not, will checkout a commit from before the move to Python and try and get that going.

from spotify-my-slack.

ksession avatar ksession commented on June 14, 2024

@StephixOne Are you able to help me possibly set this up? If not, no worries! I'm trying to do it similarly for my company.

from spotify-my-slack.

StephixOne avatar StephixOne commented on June 14, 2024

@ksession Could you tell me where you're getting stuck? I'm happy to help if I can, but this might be easier over some form of IM. The handiest one I have is Discord: Stephix#0001

from spotify-my-slack.

ksession avatar ksession commented on June 14, 2024

from spotify-my-slack.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.