Beispiel #1
0
        public static void DropCreateAll(IDbCore _db)
        {
            const string SQL_TRACKS_TABLE = ""
                                            + "CREATE TABLE track ( track_id SERIAL PRIMARY KEY, album_id INTEGER NOT NULL, name text NOT NULL, composer TEXT );";
            const string SQL_ARTISTS_TABLE = ""
                                             + "CREATE TABLE artist ( artist_id SERIAL PRIMARY KEY NOT NULL, name text NOT NULL );";
            const string SQL_ALBUMS_TABLE = ""
                                            + "CREATE TABLE album ( album_id SERIAL PRIMARY KEY NOT NULL, artist_id integer NOT NULL, title text NOT NULL );";

            _db.TryDropTable("artist");
            _db.TryDropTable("album");
            _db.TryDropTable("track");
            _db.TryDropTable("artistdocuments");

            int result = _db.TransactDDL(SQL_ARTISTS_TABLE + SQL_ALBUMS_TABLE + SQL_TRACKS_TABLE);
        }
Beispiel #2
0
        public static void DropCreateAll(IDbCore _db)
        {
            const string SQL_TRACKS_TABLE = ""
                                            + "CREATE TABLE Track ( TrackId INTEGER PRIMARY KEY AUTOINCREMENT, AlbumId INT NOT NULL, Name text NOT NULL, Composer TEXT );";
            const string SQL_ARTISTS_TABLE = ""
                                             + "CREATE TABLE Artist ( ArtistId INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, Name TEXT NOT NULL );";
            const string SQL_ALBUMS_TABLE = ""
                                            + "CREATE TABLE Album ( AlbumId INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, ArtistId INT NOT NULL, Title text NOT NULL );";

            _db.TryDropTable("Artist");
            _db.TryDropTable("Album");
            _db.TryDropTable("Track");
            _db.TryDropTable("artistdocuments");

            int result = _db.TransactDDL(SQL_ARTISTS_TABLE + SQL_ALBUMS_TABLE + SQL_TRACKS_TABLE);
        }
Beispiel #3
0
    public static void DropCreateAll(IDbCore _db) {
      const string SQL_TRACKS_TABLE = ""
        + "CREATE TABLE track ( track_id SERIAL PRIMARY KEY, album_id INTEGER NOT NULL, name text NOT NULL, composer TEXT );";
      const string SQL_ARTISTS_TABLE = ""
        + "CREATE TABLE artist ( artist_id SERIAL PRIMARY KEY NOT NULL, name text NOT NULL );";
      const string SQL_ALBUMS_TABLE = ""
        + "CREATE TABLE album ( album_id SERIAL PRIMARY KEY NOT NULL, artist_id integer NOT NULL, title text NOT NULL );";

      _db.TryDropTable("artist");
      _db.TryDropTable("album");
      _db.TryDropTable("track");
      _db.TryDropTable("artistdocuments");

      int result = _db.TransactDDL(SQL_ARTISTS_TABLE + SQL_ALBUMS_TABLE + SQL_TRACKS_TABLE);
    }
Beispiel #4
0
    public static void DropCreateAll(IDbCore _db) {
      const string SQL_TRACKS_TABLE = ""
        + "CREATE TABLE Track ( TrackId INTEGER PRIMARY KEY AUTOINCREMENT, AlbumId INT NOT NULL, Name text NOT NULL, Composer TEXT );";
      const string SQL_ARTISTS_TABLE = ""
        + "CREATE TABLE Artist ( ArtistId INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, Name TEXT NOT NULL );";
      const string SQL_ALBUMS_TABLE = ""
        + "CREATE TABLE Album ( AlbumId INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, ArtistId INT NOT NULL, Title text NOT NULL );";

      _db.TryDropTable("Artist");
      _db.TryDropTable("Album");
      _db.TryDropTable("Track");
      _db.TryDropTable("artistdocuments");

      int result = _db.TransactDDL(SQL_ARTISTS_TABLE + SQL_ALBUMS_TABLE + SQL_TRACKS_TABLE);
    }