How To Migrate Database With Flask - Flask Fridays #11

How To Migrate Database With Flask - Flask Fridays #11

Codemy.com

3 года назад

30,091 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@ayomikunadetayo645
@ayomikunadetayo645 - 01.02.2024 00:13

@Codemy
I am new using flask, with your sessions, i am getting well along, but the Migration have been giving me migraine. I have been running into this error:
Usage: flask [OPTIONS] COMMAND [ARGS]...
Try 'flask --help' for help.

Error: No such command 'db'.

(VIRTUAL1) C:\Users\dell\Desktop\FLASK_B>

Please i need your assistance on this

Ответить
@user-ut5go5ni5d
@user-ut5go5ni5d - 15.11.2023 19:42

Only I think that this guy needs millions of likes and subscribers?

Ответить
@teclote
@teclote - 24.10.2023 20:56

Outstanding, thank you.

Ответить
@callumlawrence1427
@callumlawrence1427 - 04.08.2023 19:25

Migration was giving me a migraine...this helped massively!!!

Ответить
@sjackson330
@sjackson330 - 28.04.2023 18:15

Not sure if this will help anyone else, but I had to use the following commands in VS Code:
- Instead of flask db init / I used flask --app=hello db init (there are two hyphens in front of app)
- Instead of flask db / I used flask --app=hello db
- and so on.....

I'm not sure if I'm doing something wrong, but this worked for me.......

Ответить
@gofyourselfgoogle875
@gofyourselfgoogle875 - 13.03.2023 18:39

This whole fucking tutorial has helped me bring an application to life, but this one in particular really saved my hide. Thanks!

Ответить
@nimrodshefi2046
@nimrodshefi2046 - 23.02.2023 14:50

Using this replaces the need to create a schema.sql file and updating it as I'm adding to the db. Right?

The SQLAlchemy and flask_migrate libraries are creating the schema for me in the background.

Also, while not causing me an error, when I a import flask_migrate, I get this warning message: Import "flask_migrate" could not be resolved from sourcePylancereportMissingModuleSource)

Not sure why. I followed the same steps as you. Is it because I am using different versions of everything?

Ответить
@yomajo
@yomajo - 28.12.2022 23:04

In memory database? Adding flask migrate to existing project is a different process as shown in extention author's Miguel video.

Ответить
@hazadus
@hazadus - 02.09.2022 23:40

You need to run `flask db upgrade` right after `flask db migrate -m '...'` for this to work properly. Thanks for great tutorial!

Ответить
@albertusschrier7867
@albertusschrier7867 - 20.08.2022 14:51

This is hilarious, I can't believe this worked.

Ответить
@al-aminibrahim1394
@al-aminibrahim1394 - 19.06.2022 14:48

thanks, mine is saying command flask not found when i run flask db init. help please

Ответить
@123pencilboy
@123pencilboy - 10.06.2022 12:09

I have to point out that flask db migrate will not work if the SQLalchemy model inherits "Base". Using flask-migrate with declarative base instead of db.model did not work for me. Once I got rid of declarative base it worked.

Thanks for making this video!

Ответить
@eritreawoldu4848
@eritreawoldu4848 - 05.04.2022 14:12

Thank you so much

Ответить
@volodymyrvintila4154
@volodymyrvintila4154 - 03.04.2022 23:01

Thank you! I so lik Flask Friday!

Ответить
@briangrover1625
@briangrover1625 - 29.03.2022 05:23

fantastic tutorial! Thank you!

Ответить
@irineu6169
@irineu6169 - 22.01.2022 16:11

amazing, thank's

Ответить
@maheshpanchajanya2803
@maheshpanchajanya2803 - 11.12.2021 10:09

hi sir wheni try to migrate in flask or try to run flask run/flask db init or anything related to migration im getting value error : entry points must be listed in groups pls help me with this.

Ответить
@Adryell
@Adryell - 05.12.2021 01:17

Thanks for portuguese subtitles

Ответить
@sebastianmedina5106
@sebastianmedina5106 - 29.09.2021 17:51

thanks you!

Ответить
@daggercentral9818
@daggercentral9818 - 21.05.2021 11:08

$ flask db migrate -m 'initial migration'
d:\websites\flask_2\virtual\lib\site-packages\flask_sqlalchemy\__init__.py:872: FSADeprecationWarning: SQLALCHEMY_TRACK_MODIFICATIONS adds significant overhead and will be disabled by default in the future. Set it to True or False to suppress this warning.
warnings.warn(FSADeprecationWarning(
INFO [alembic.runtime.migration] Context impl MySQLImpl.
INFO [alembic.runtime.migration] Will assume non-transactional DDL.
ERROR [flask_migrate] Error: Can't locate revision identified by '4c48abc2c62b'

can't run

Ответить
@mynameisgod1135
@mynameisgod1135 - 15.05.2021 12:00

migration command is not working. i used workbench to create the field password_hash.any problem?

Ответить
@plusk343
@plusk343 - 25.04.2021 21:03

Heard of Svelte? I guess you would be a great person to learn Svelte from :)

Ответить
@umeshpurohit5252
@umeshpurohit5252 - 23.04.2021 20:42

Great Sir!!

Ответить
@idk____idk6530
@idk____idk6530 - 23.04.2021 16:57

After A long Time 🔥 Flask 😎😎

Ответить