Delete tables/databases on railway

theo-nejmHOBBY

8 months ago

How can I delete a table or reset my database on railway?
I want to re-migrate all my data.

0 Replies

theo-nejmHOBBY

8 months ago

75f448f4-88c9-4d82-b428-61740d90e40c


theo-nejmHOBBY

8 months ago

I can create new tables, but i dont know how to delete existing ones


8 months ago

you want to wipe your entire database?


theo-nejmHOBBY

8 months ago

yes, delete all tables to migrate them again


8 months ago

wipe the volume then


theo-nejmHOBBY

8 months ago

but i dont want to remove the service because of the envs


theo-nejmHOBBY

8 months ago

i dont want to re-create the mysql image


theo-nejmHOBBY

8 months ago

cant I just drop the database?


8 months ago

yep, wipe the volume, this will give you a brand new database


theo-nejmHOBBY

8 months ago

how?


8 months ago


theo-nejmHOBBY

8 months ago

oh


theo-nejmHOBBY

8 months ago

that helps


theo-nejmHOBBY

8 months ago

tks


theo-nejmHOBBY

8 months ago

OH I LOST MY DATA


theo-nejmHOBBY

8 months ago

just kidding


theo-nejmHOBBY

8 months ago

lmao


theo-nejmHOBBY

8 months ago

thanks, Brody


8 months ago

in preparation of you saying something like this i had edited my above message to be clearer haha


theo-nejmHOBBY

8 months ago

hahaha


theo-nejmHOBBY

8 months ago

im facing a new issue


theo-nejmHOBBY

8 months ago

my healthcheck is not working for any reason


8 months ago

for the record we wouldnt have been able to do anything anyway


theo-nejmHOBBY

8 months ago

locally my route is working perfectly


theo-nejmHOBBY

8 months ago

the /health app route is working fine, returns a 200


theo-nejmHOBBY

8 months ago

oh I can mind what is happening


theo-nejmHOBBY

8 months ago

probably the service is not starting because I didnt set up a redis service on railway yet


theo-nejmHOBBY

8 months ago

imma try to fix this to see if this is the problem


8 months ago

yeah connect ECONNREFUSED ::1:6379
this deploy hasnt started its web server so its not going to answer the health check


theo-nejmHOBBY

8 months ago

yeah, ive imagined, forgot about the redis


theo-nejmHOBBY

8 months ago

tks


theo-nejmHOBBY

8 months ago

hmmm redis connection still refused


theo-nejmHOBBY

8 months ago

but now ive configured the variables


theo-nejmHOBBY

8 months ago

yeah, econnrefused ::1.6379


theo-nejmHOBBY

8 months ago

looks like it cant connect to db


theo-nejmHOBBY

8 months ago

is this possible to connect via internal host?
redis.railway.internal


theo-nejmHOBBY

8 months ago

i've set my envs
REDISHOST REDISPORT
REDIS_PASSWORD


theo-nejmHOBBY

8 months ago

another question, my estimated usage went from 5 cents/mo to $2/mo when I set up redis, is that correct?


theo-nejmHOBBY

8 months ago

is there anything I can do to connect redis in this cases?


8 months ago

you set the variables, but are you consuming them in code?


theo-nejmHOBBY

8 months ago

yes, sure


theo-nejmHOBBY

8 months ago

export const RedisOptions: CacheModuleAsyncOptions = {
  isGlobal: true,
  imports: [ConfigModule],
  useFactory: async (configService: ConfigService) => {
    return {
      store: redisStore,
      host: configService.get('REDIS_HOST'),
      port: Number(configService.get('REDIS_PORT')!),
      password: configService.get('REDIS_PASSWORD'),
    };
  },
  inject: [ConfigService],
};


theo-nejmHOBBY

8 months ago

can this be the problem?


theo-nejmHOBBY

8 months ago

i managed to fixed it by adding family: 0 in my redis config. it seems needs when connecting to private network

theo-nejmHOBBY

8 months ago

is this needed?


8 months ago

i dont know if that would be valid syntax, but given you are getting econnrefused ::1.6379 im going to say no, that is not valid syntax


theo-nejmHOBBY

8 months ago

it is a valid syntax, locally it works with my redis


8 months ago

not necessarily, if it was valid your app would not be attempting to connect to ::1


8 months ago

thats a fallback hostname that indicates that the redis client is using its default values to attempt a redis connection, instead of using the REDIS_HOST


8 months ago

no its has nothing to do with the current error


theo-nejmHOBBY

8 months ago

k got it


theo-nejmHOBBY

8 months ago

solved the problem here


theo-nejmHOBBY

8 months ago

all done


8 months ago

awsome, what was the issue


theo-nejmHOBBY

8 months ago

actually the lib's doc was wrong


8 months ago

you'll have that


theo-nejmHOBBY

8 months ago

the lib that integrates redis on nest


theo-nejmHOBBY

8 months ago

well, the last update was in 2022, its expected haha


8 months ago

makes sense, glad you got it fixed


theo-nejmHOBBY

8 months ago

tks for the help, Brody


8 months ago

no problem!