iScrE4m
iScrE4m

Reputation: 882

Remote .db file doesn't change

I'm using cyclone to develop an application on OpenShift.

That application uses sqlite3 to connect to .db file and changes it.

script_dir = os.path.dirname(__file__)
rel_path = "database/main.db"
database = sqlite3.connect(os.path.join(script_dir, rel_path), timeout=1)
database.row_factory = sqlite3.Row
db = database.cursor()

def closegame(id):
    db.execute("UPDATE games SET Running = 'No' WHERE ID = ?", (id,))
    database.commit()

Ideally I'd love for the file to never be overwriten by push, but to be able to download it by pull. If that's not possible, just being able to pull it would be nice.

Upvotes: 0

Views: 40

Answers (1)

iScrE4m
iScrE4m

Reputation: 882

The problem was my lack of understanding git. Git is supposed to be used for source files, not for actual data. Therefore we should be downloading the database when we need it through scp

In Openshift, the working .db file can be found in app-root/repo/

Therefore the final command in console is

rhc scp appname download localpath app-root/repo/path/to/file

Upvotes: 1

Related Questions